bug fix image insertion