remove unused code from CheckImageCompression