update upload image function