update image to scale and center