Further JPG optimizations