Added imageOrientation parameter to define the orientation for resized images.