Loading unduplicated random images

I have a number of images I’d like to appear in a random stacked order. I’m just starting with 3 for now but it could go as many as 24. Right now I just want the variables to each have a unique number that will become a keyframe number in a MC holding all the images.

This is my code that almost works…

dork = random(3)+1;
trace ("dork = " + dork);

cat = random(3)+1
if (cat != dork){
    trace("this works");
    
} else {
    cat = random(3)+1
    trace ("trying again");
    
}

trace ("cat = " + cat);

dog = random(3)+1
if (dog != cat and dog != dork){
    trace("this dog works");
    
} else {
    dog = random(3)+1
    trace ("trying dog again");
    
}

trace ("dog = " + dog + newline + "=============");

Thanks in advance!