Fix pointer problems in functions and return the evaluate image to normal