The problem seems to be fixed by using: UIImage imageWithCGImage:scale:orientation:
as below.
UIImage *renderedImageWithOrientation = [UIImage imageWithCGImage:renderedImage.CGImage scale:1 orientation:0];
I run this after rendering the image, then I add the image to the imageView.