properly scaling the image