fixed a bug with image upload