Resizes the image when the slider moves