I've found another way to do this that seems like a simple solution compared to adding row numbers to your gallery.
Note: (This specific method will only work if you have a list sorted by an ID column. The numbers can be spontaneous, meaning you could have a list like: [1, 10, 35, 102] and it would still select the next and previous numbers)
If you set the ID of your gallery item in a variable upon selecting the item, this method works. For your edit/display form selected item, you would just use:
LookUp(DataSource, ID = varSelectedID)
In the OnSelect portion of your Gallery:
Set(varSelectedID, ThisItem.ID);
Or
UpdateContext({varSelectedID: ThisItem.ID});
Then, in your next button's OnSelect property: (This selects the next lowest number, the max of all IDs less than the currently selected ID)
Set(varSelectedID, Max(Filter(Gallery.AllItems, ID < varSelectedID), ID));
Or
UpdateContext({varSelectedID: Max(Filter(Gallery.AllItems, ID < varSelectedID), ID)});
And in the previous button's OnSelect property: (This selects the next highest number, the min of all IDs greater than the currently selected ID)
Set(varSelectedID, Min(Filter(Gallery.AllItems, ID > varSelectedID), ID));
Or
UpdateContext({varSelectedID: Min(Filter(Gallery.AllItems, ID > varSelectedID), ID)});