This Geeklog PHP function uses the Gallery Random Block code contibuted by Bhara t Mediratta - Gallery Developer It uses all gallery API calls and does not have a problem with empty albums or r estricted albums.
Please see the INSTALL.txt for notes on changes.
This block has been tested with Geeklog-1.3.8-sr1 and Gallery 1.4-pl1 (installed via the new gallery integration).