What image are you talking about? When you save the changes to the page?
I should have probably mentioned that there is also a characther limit when placing tags in the header. If you go over that limit then you could possibly get errors due to an open tag. I don't know what the limit actually is, so if you are placing a full script in the header, I would advise against it.
Best approach is to add a reference to the script and place the script in your js folder.
I learned the hard way:http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/108/threadid/237084/scope/posts/Default.aspx
Also make sure you are trying to enter the script reference in the "PAGE" header, and not the header under module settings. Some scripts can run under the module settings header, but rarely get loaded in the header tag. If you have a script that needs loaded in the header tag, you will need to do it under page settings.
For a much safer solution, there are some 3rd party modules out there on Snowcovered that can inject your scripts where you need them. I believe Will Strohl also came up with an opensource script injector that can be found on CodePlex.
If you used my example code, be sure to remove the extra spaces before and after the < and >