Added orientation parameter to rotate image.