fix image function