fixed bug when reading tiff files