Function for random number with no repeats?

Hello, I’d like to have a random number generator that, once it chooses a number, deletes it from the pool of possibilities (it’s for a photo gallery that shuffles images from an array)…either that or it keeps repeating the function until it gets a number that hasn’t been used.

Any help would be greatly appreciated! Thank you!