Hi Pamela:
It looks like you're calling randperm for each iteration of your loop, but I think you just want to call randperm once right? I'm not sure I followed your code exactly, partly because I was confused about img (the input argument) vs. images (where you have the file name).
Here's some code that shows a generic loop which operates on 10 unique (no replacement) random files:
all_filenames=... % Here's where you get a list of all filenames, one per cell, presumably 100 long
ind = randperm(100,10); % list of 10 unique values selected from 1:100
for i = 1:10
this_filename = all_filenames{ind(i)}; % get the filename from one of the randomly selected values
% here's where you'd do something with the filename
end