Xml slideshow- setinterval() counting pre-loading time of images

I was working on my portfolio site and i created an xml slideshow with the help of postings from this forum. Everything is working fine but when i uploaded my swf in a temporary webspace and tested i noticed a strange thing which i cannot figure out the cause. The setinterval delay time is counting the time of preloading too. so the big size images are sometimes skipped and next image is getting loaded. here is my code.

delay = 10000;
this.fadeSpeed = 5;
this.fadeOutSpeed = 10;
var fadOutInt:Number;

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“main.xml?task=refresh”);
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevact();
};
next_btn.onRelease = function() {
nextact();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
numload_txt._visible = true;
if (loaded != filesize) {
numload_txt.text = Math.round(loaded/filesize * 100) + " %";
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
numload_txt._visible = false;
if (picture._alpha<100) {
picture._alpha += fadeSpeed;
}

}
}
function setstage(){
picture._alpha = 0;
desc_txt._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
slideshow();
}
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
setstage();
}
}
}
function prevact() {
clearInterval(myInterval);
if (p == 0){
p = total - 2;
} else {
p = p - 2;
}
fadeOut();
}
function nextact() {
clearInterval(myInterval);
fadeOut();
}
function firstImage() {
if (loaded == filesize) {
setstage();
if (total <= 1){
clearInterval(myInterval);
}
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
fadeOut();
}
}
}
function fadeOut() {
fadeOutInt = setInterval(fadeOutImg, fadeOutSpeed);
}
function fadeOutImg(){
if(picture._alpha < 1){
clearInterval(fadeOutInt);
loadNextImg();
}
else{
picture._alpha -= fadeOutSpeed;
desc_txt._alpha -= fadeOutSpeed;
updateAfterEvent(); // refresh according to setInt delay, not framerate
}
}
function loadNextImg() {
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}

Pls have a look and help me to figure out why this is happening.
Thank you