update compress image method