Fixing image handling for compression