Implemented the rotation of the image.