bug fix image.onload