More work on jpeg stuff