jQuery (and JS) do not wait for the function to complete before executing statements.
A couple of ways of doing this this are outlined here
You might also consider pre-caching
the big image(s). That is, creating new Image()
's and setting their src
to the big images as, or just after, the page has loaded.