added image compression before upload