Rewrite of tiff reader code to support loading of grayscale images.
Adds handling of images with 1 sample per pixel which usally dont have
any planar config set. This fixes bug #9747 and #9699.
Merge pull request #414 from hean01/tiffreader

Rewrite of tiff reader code to support loading of grayscale images.