fixed minor issues with image upload