Ok so I have this .htaccess file and I'm confused how to get it to do what I want. Here is the code

RewriteEngine ON
RewriteBase /

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.+) $1 [L]

RewriteRule ^(.*)/(.*)$ index.php?resource=$1&page=$2 [L]
RewriteRule ^(.*)$ index.php?resource=$1 [L]
It works perfectly as is, but I'm trying to add it so that if there is more to it for example /viewgal/photos/2 or /viewgal/photos/landscape/3 basically I want everything after photos in this case to be added to &qry=landscape/3. I tried adding this:
RewriteRule ^(.*)/(.*)/(.*/*)$ index.php?resource=$1&page=$2&qry=$3 [L]
RewriteRule ^(.*)/(.*)/([.*/]*)$ index.php?resource=$1&page=$2&qry=$3 [L]
But that doesn't work. Basically I want everything after that to be in one $_GET variable called $qry that I can process how i want in each controller. Basically it goes /controller/function/arg/ume/nts and i want it to rewrite to index.php?resource=controller&page=function&qry=arg/ume/nts Like i said as long as I don't send arguments it works just fine, I'm trying to add arguments and I can't figure out.

Any help would be greatly appreciated!