some modifications of image upload