There are some gallery scripts that depends on PHP's __FILE__ directive to return the absolute filesystem path of the current file. Due to a bug in PHP, __FILE__ returns a relative path in older PHP versions.

* In most cases, you can fix the problem by convincing your webhost to upgrade the PHP version.
* For some rare platforms, the bug still exists in the latest PHP version. In this case you need to file a bug report for PHP such that the bug gets fixed for that platform too. E.g. PHP 4.4.4 on SunOS 5.8 returns the filename without any path if any of the parent folders of your Gallery folder is not readable by the webserver user.