Added automatic scaling of the image