fixed minor problems with image uploading