How do I assign items in a dropdown list with a script?

I have a list of strings and a list of images with the same name, how do I write a script that assigns 10 of them in a dropdown in a random order?

Anyone?