Gallery generation, displaying image on new tab, some improvements