well you can surpress the error by doing this in showgallery.php I would think. its the last line in the code block I posted above all I did here is encapsulate the $ppuser variable.
Content visible to verified customers only.
Honestly I still dont see how that query would ever be ran because as previously stated its only active if $ppuser is not empty so you should not have an issue. Maybe a hack conflict if this is vb