All my files ending with *.php did not show any pictures when reopened in Juicebox Pro Builder, just the thumbnails.
If you have renamed your gallery index page with a .php file extension, then this suggests that you have modified the file (by adding custom PHP code), otherwise you could have just used .htm or .html, both of which work fine within JuiceboxBuilder's internal browser.
If you make any modifications to a gallery's index page and then open the gallery (to edit it) in JuiceboxBuilder and resave the gallery on the 'Publish' tab, then the file will be overwritten and any modifications that you have made (including any custom PHP code that you have added) will be lost.
A gallery's index page is designed to display the gallery on a page of its own, no more, no less. If you need further functionality, then I would recommend that you copy the index page and modify the copy. That way, JuiceboxBuilder will be free to overwrite the original index page without your modifications being lost.
If you embed your galleries in other web pages (and do not need or want to display the galleries on pages of their own), then there is no need to use the gallery index pages at all and you can simply ignore them (leaving their file extensions as .htm or .html).