Here I made a working example using a cube. (specify the correct folder for your pictures)
Then simply call the ApplyRandomTextureFromFolder function with the material index you want to change.
I would set this up in the actor that you want to change textures on. And call the function from the UI.