Fixed bug that caused the original image to be saved even if dimensions exceeded max_width