Placing the image in the middle of the frame automatically