PhpWebGallery is not in upgrade mode. In include/mysql.inc.php, insert line
define('PHPWG_IN_UPGRADE', true);
if you want to upgrade