fix image parsing