Added the function that shows the image on the main thread. Added error-check for when the popover is already open