fixing image upload bug