the problem however, is that your program does WORSE than nothing with it. if a random string is presented as a cat, one which simply doesnt exist... rather than handling it as an error, it presents all of the galleries content.
That is because it is suppose to as there is an option to show all photos which is why as I initially said cat=all if it is not numeric.
What I said does indeed work Message - PhotoPost Photo Gallery
There is one more thing you might want to modify up at the top of the file on the typecast line where cat is STRING change that to INT
Content visible to verified customers only.
I understand exactly what your saying but you need to understand it is not our place to fix google issues. The problem is as I see it is why is google indexing spam bot urls in the first place and where. They are not getting the urls from our application.