Fix for model determination and rotating landscape images

First modification is a fix so that the right model code is determined when the image is in landscape orientation. 
The second modification rotates all landscape images to 90°.