trying to get around jpeglib stupidity