Image resizing when it is outside of pdf's dimensions.