To prevent errors like these you might want to spend a few hours on new loading functions with proper error reporting.
Something like this:
..but then a whole lot o' functions like these.
Something like this:
Function LoadImage2(f$,flags=1) i=LoadImage(f$,flags) If not i RuntimeError "Image ["+f$+"] not found!" Return i End Function
..but then a whole lot o' functions like these.