You bet!
See where you got:
$result = mysql_query("SELECT max(id)-1 as id,cat,bigimage FROM pp_photos order by id DESC LIMIT 1" ) or die(mysql_error());
use this instead:
$result = mysql_query("SELECT max(id)-1 as id,cat,bigimage FROM pp_photos order by id DESC LIMIT 5" ) or die(mysql_error());
Just updated the "LIMIT" argument in the SQL call. You already have a while loop to go through all results returned, so everything else is just fine
Have fun!