You need to turn off mod_negotiation
At the top of your htaccess file, add:
Options -MultiViews
Mod_negotiation sees a request like /photos/thumb/something
, and when it tries to map that URI to a file, it sees the file at /photos/thumb.php
, and thinks that the request was for that file (which it is). The problem is that this will completely bypass mod_rewrite, so your rules don't get applied.