Corrected issue #12.

Image height and width are switched when EXIF:Orientation is greater than 4, resulting in a correct calculation of the thumbnail size.
See http://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/