fix image generation