correcting protection against invalid settings for tiff images
correction to DCT decoding read errors (when buffer smaller than row)