fix image upload errors