Update image code to use fast math