Just in case anyone needs it. I've modified the query to exclude a category I have for NSFW images. This was based on help from the photopost forums. Thought I would share.
Change
Code:
$result = mysql_query("SELECT id,cat,bigimage FROM pp_photos order by rand() LIMIT 1" ) or die(mysql_error());
to
Code:
$result = mysql_query("SELECT id,cat,bigimage FROM pp_photos WHERE approved=1 AND cat NOT IN (502) order by rand() LIMIT 1" ) or die(mysql_error());
Just change the 502 to the category number you want to exclude. You should be able to add extra categories by adding numbers like so (502,503,504,505). But I am a n00b with php so I could be wrong.