some modification on image upload