var messpic = new Array(
"<img id='homepagePic' src='/images/homepage1.jpg' alt='Main Home Page Image' border='0' />",
So the <img> elements caused the issues. The solution is to make your script wrapper look like this (see CDATA section):
/* <![CDATA[ */
/* ]]> */
as mentioned here as well.