[_] jQuery losing the scope!

I'm having problems with a jQuery plugin that I've created and I'm
hoping that _ can help me shed some light.
The idea is that a user clicks on the link to an flv and then jQuery
places the flv and the associated jpg (as a default background image to
the vid) into a section of the page using JWplayer.
I've used a little bit of ajax as I want to first check that the image
exists on the file system before I use the image.
This does work. The problem though is that for some reason I'm unable to
keep a reference to the result of the Ajax call, or rather that it is
out of sync.
Online 61 and 67 you can see that the result of the ajax call is setting
a flag var called 'vid_bg_img'. The problem is that outside of the ajax
call line 74 the value is only correct when running the code for a
second time.
I've set the var to have global scope line 4
You can see the code that I've written here :
http://pastie.org/734093
I'm sure that this is due to a the scope of the flag variable, but I
think I've reached the point of seeing only trees and no wood!
I anyone can help me shed some light on this I'd be really happy.
You can see a really rough working example here :
http://perceptivefilms.firecast.co.uk/ just click on the first (this has
no associated background img) and second (this does) thumbnails and then
click on the 'for more info on this clip......'
Cheers
JP