thanks for your help but i solved my problem by inserting the html (where the images are loaded from an external REST) in the page galleryMenu, setting the component to invisible.
then on the success event of the REST:
1) i set a local storage variable to a string (containing all the html tags and the variables passed through the REST)
2) i set the html component to the localStorage value
3) i run code to view photoswipe directly in full size mode
4)i add an event handler that catch the PhotoSwipe hide event and
4.a) detatch the photoSwipeInstance
4.b) set photoSwipeInstance to null;
4.c) set the html component to empty.
I hope this solution could help someone else with the same problem.
Thanks