Fix image compression problems on resize and crop