Creating a back button / close button when image is clicked

How to create a "back button" or Close window for the new image?