Resize an image to desired height and width without affecting the aspect ratio and save the image in JPEG format with the specified quality