'admin/galleries/:gid/photos' => 'admin/photos/index',should work just fine. Note that this will not match '/admin/galleries/2/photos/17', as you haven't provided a placeholder for the segment '17'. If you want that, use
'admin/galleries/:gid/photos/(:any)' => 'admin/photos/index/$1',whatever the contents of $1 is will be passed as the first parameter of your action_index() method.
It looks like you're new here. If you want to get involved, click one of these buttons!