in the galleries/global.php file, try adding the following at line 2:
unset($_SERVER['DOCUMENT_ROOT']);
then locate the following code:
$pg_config = array(
'path' => str_replace('galleries/', '', str_ireplace(str_ireplace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT'])), '', $abs_prefix)),
'html_prefix' => str_ireplace(str_ireplace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT'])), '', $abs_file) . '/'
);
and change it to:
$pg_config = array(
'path' => "/".str_replace('galleries/', '', str_ireplace(str_ireplace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT'])), '', $abs_prefix)),
'html_prefix' => "/".str_ireplace(str_ireplace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT'])), '', $abs_file) . '/'
);