Initial work on JPEG codec