Just scale down images, if the user passes a bigger value to maxwidth or maxheight than the actual image limits, it will return the actual image