Added comments for each function
Added functionality to the image window that allows the calling
application to permit the window to close the application on close