added image compression stat calculation