Fix opening 358MPix Tiff

With following changes DT can now open 358MPix Tiff file produced by Hugin. (16 bit, 4ch)
I also tested it on all combinations of TIFF's DT can produce - no regressions.
Also some generic cleanup.

TODO: BigTIFF support.