Corrected JPEG encoding