checking error in image upload