tried to fix image upload bug, not yet done