Added a convenience method to resize to fit within the specified dimensions while retaining the original aspect ratio.