Fix handling of tiff files