Preloader for my script? Can it be done?

I ahve this random picture generator which loads into a emply MC but on a 56k connection the picture takes too lond to appear can i preload the image with the script too?

picTotal = 18;
// adjust per total pics, img1.jpg,…,imgN.jpg, where N=picTotal
name1 = “img”+Math.ceil(Math.random()*picTotal)+".jpg";
loadMovie(name1, _root.BG);
preloadI = setInterval(preloadF, 10);
function preloadF() {
if (_root.BG.getBytesLoaded()>=_root.BG.getBytesTotal()) {
// reference the target level or clip.
_root.BG._x = 0;
// lines up your background pics.
_root.BG._y = 0;

i have no idea how to do it?