Alright, got it to work by simplifying the code Jaxkr provided. Thanks Bro! Money sent.
Thanks for the info. It seems a workaround to image caching isn't necessary in this case because the URLs used aren't referencing an actual image file. So from what I can tell it doesn't cache the images anyway.