Don't know if this is the problem or not, but iNdx is being incremented in the loop for your x var, which I think is the pictures.
Also, I don't see how iNdx is reset after reaching the last folder (folder4).... If it starts with Random3, then it will try to then load from Random4, then Random5 and then Random6.... there doesn't appear to be any check for when iNdx exceeds its limits.


TG