I wanted to quickly detail what I did to get Gallery-1.3.1 to work on BSD, php, and Apache. There were some functions that used the file_exists function. However, recent versions of PHP have some issues using that function with just the filename and no path. All I need to do to correct this was call the realpath function on the filename. Had to make a few replacements, but worked fine!