Currently the show() function looks like this:
/**
* Move the gallery to a specific index
* @param `index` {number} - the position of the image
* @param `gallery` {array} - gallery which should be opened, if omitted assumes the currently opened one
* @return {boolean} - true on success or false if the index is invalid
*/
function show(index, gallery) {
if (!isOverlayVisible && index >= 0 && index < gallery.length) {
prepareOverlay(gallery, options);
showOverlay(index);
return true;
The comment says that the gallery argument can be omitted. Still, the condition takes gallery.length, which is a TypeError if gallery==undefined. The other show...() functions (from line 603 to 627) all use show() with one argument only.