Adding orientation detection. Trying to do analysis to refine the images...