fix image upload javascript