Make sure to handle the "BASE" tag instead of document.location.href, should be an util function - Fix 404 for opening images in external window.