fix image upload and resizing