refactor Tiff metadata extraction.