In Leaflet I have an link in the popup window that opens a new window with the related image, if the image is missing it freeze the application, to solve that I create a default