added image compression for thumbnail