I thought this line of script had something to do with the Contact Form 7 plugin, which we are using. The wpcf7-submit was my first clue...then I found out CF7 loads on every page by default, even if there is no CF7 form on the page so I was even more suspicious.
But, alas, Miss Marple I am not...after much searching and finally uninstalling the plugin, I discovered this line of script was hardcoded in the theme we are using. No idea why that would be the case but I finally managed to remove it.
No more syntax error but the disappearing image problem still exists.