Create a table with three images like so:
Now write code so that when you click on one and then another, the two exchange.

Now, make it work continually. like this