Fixed a bug with image upload