In some cases images may not appear in the order in which they are in the HTML source, for example for custom galleries. In this case you can use the tabindex
attribute in the image links to tell the browser which image comes first, which is second and so on. If this attribute is present, Lightbox with PhotoSwipe will also sort the images in the lightbox based on the numerical values of that attribute.
Image 3 (tabindex 10):
Image 1 (tabindex 1):
Image 2 (tabindex 2):