I think it can be done if you have php knowledge. You develop a new theme. In header and footer you include php files used by the website.
Supposed the website you want to include is like that :
<?php
include "header.php";
include "main_content_depending_on_page.php";
include "footer.php";
To manage Piwigo, you can do almsot the same reusing header.php and footer.php. Of course it depends of the way your main website is done.