Added code to change page orientation to landscape if the width of the image is greater than the height