@dimsemenov PhotoSwipe is great, thanks! Have you considered applying visibility: hidden to the parents of non-current images? Maybe this will reduce repaints and improve performance when some of the images are animated GIFs.
@andfinally, PhotoSwipe keeps only 3 slides in DOM, I don't think that hiding 2 nearby slides will increase performance much, but it should be tested to tell for sure. You can hide them in afterChange event gallery.itemHolders, gallery.itemHolders are prev and next slide DOM elements.