Switching images between subwindows

I have an question on how to switch an image from one subwindow to another subwindow.

My aim is to select a subwindow or image from one window and have it placed into a subwindow that i have then selected.

Any ideas or examples from people will be much appreciated.