possible fix for tiff write assert fail