Your server's php error reporting is set too high. The correct resolution would be to adjust to normal error reporting as you should not be seeing warning for empty variables.
You can remove the code if you cant adjust php as its just a simple safety check that if a photo variable is passed then forward them to showphoto
if ( is_numeric($argv[0]) ) {
header("Location: {$Globals['maindir']}/showphoto.php?photo={$argv[0]}");
exit;
}