I presume it's tumblr that is doing this, perhaps deliberately to break your script. But I can't, personally, help you with tumblr.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity
." Me Myself & Irene
Validate your HTML