Hey Wil,
Yeah your right in saying that you won't be able to access vB conditionals outside of a vB page. You could strap this image director into a vB page to access those conditionals but if you managed to get it working just by requiring ./global.php then thats probably a lot easier!
I can't think off the top of my head why its working but - if it works and you aren't getting database errors then whos complaining! good work, its not often that solutions turn out to be so simple

- on a side note, it might pay to check this in a couple of browsers with different cookie settings to make sure it consistently works.