Not sure why it worked, but moving point where I inserted the script to set the variable $Image99 (as well as the 'include' for the second script) cured the problem. I put them at the end of the script and when the second script ran the calculation showed on the page.