If the openOutputImage() routine is used to write a primary header, then the file designated by the filename must NOT already exist. If it does already exist, an error is returned. If the openOutputImage() routine is used to write an extension image, that HDU is appended to the end of the file.