The "cmd=thumb" element is in the query string, not in the body of the URL, so you have to use different wording.
You're currently using
so I wondered if SetEnvIf Query_String would work. Can't test it myself because I don't use query strings except internally, but someone should know.
:: looking vaguely around for g1 or someone like him ::
And if you can't do this with mod_setenvif, the alternative way using mod_rewrite should be straightforward. It may help to remember that the environmental variable by itself (in this case "dontlog") doesn't do anything. It's just a way of carrying a message.