Near the top, to prevent an unwanted header warning when embedding minigalnano into a webpage, we suppress the sending of a header
<code>
header('Content-Type: text/html; charset=UTF-8'); // We use UTF-8 for proper international characters handling.
</code>
with
<code>
if (!defined("GALLERY_ROOT")) {header('Content-Type: text/html; charset=UTF-8');} // We use UTF-8 for proper international characters handling.
</code>

The thumb_integrate variable is missing and you get a question mark instead of a thumbnail. What is happening is a the minigalnano folder name is mistakenly coming out in the call for a thumbnail file which tries to find the wrong file.

First define the thumb_integrate variable
<code>
$thumb_integrate = "";
</code>

So directly under the line with
<code>
$templatefile = GALLERY_ROOT . "templates/integrate.html";
</code>
put
<code>
$thumb_integrate = str_replace('?dir=','albums/index.php?dir=',str_replace('><em>',' target="_blank"><div class="thumbnail"><em class="caption">',str_replace('<img ','<img width=190 class="img-thumbnail" ',str_replace('<span></span>','<span><br /></span>',str_replace('albums%2F','',str_replace('</a>','</div></a>',$thumbnails))))));
</code>

assuming the minigalnano is installed in a folder named ''minigal''\\
and we want a thumbnail of ''190'' instead of ''320''\\
and a new tab when we click on the thumbnail

and add the line somewhere near the bottom
<code>
$template = preg_replace("/<% thumb_integrate %>/", "$thumb_integrate", $template);
</code>

to use thumb_integrate in the ''integrate.html'' template


To point to a photo directory outside the album, it is much easier to symlink the photo and thumbs directory using a PHP script
<code>
<?php
$target = '../../albums/photos';
$shortcut = 'photos';

symlink($target, $shortcut);
echo readlink($shortcut).'<br />';

$target = '../../albums/thumbs';
$shortcut = 'thumbs';

symlink($target, $shortcut);
echo readlink($shortcut);
?>
</code>
in the folder where you wish to make the symlink. Adjust the target path.