made some corrections for orientation of images