Working on JPEG codec