In CSS, any image path is relative to the CSS file location.
f.ex if I put the CSS file in /media/css/mystyles.css and use something like
/media/css/mystyles.css
You can flip through 's childNodes, find your tag, get the url of said script, and compute the url of your image.