Handling of conversions to/from JPEG