improving popup image viewer