I'm no good with javascript so I can't help with code. But couldn't you actually use a html marquee (although they seem to annoy most people).. and put the image in that?
I can't offhand remember if it's depreciated or not though but:
<marquee behavior="alternate" width="100%" height="100px"><img src="image.jpg" /></marquee>
That should bounce back and forth too..
EDIT: I forgot to mention that you must be aware that it won't render in all browers. But does work with Firefox and IE. So you're safe with those two.. Though I'm not sure the web standards guys will be too happy.
