Fix bug with image upload