TMI-TIFF: Safer getImageTypes + minor code cleanup. No functional changes.