Add set_quality for JPEG mode