fix resizing when the image is too large for page to render