I'm working on a photo gallery that uses "Friendly" URLs, and so far everything is working quite well.

I have a Rewrite rule that makes this:
/gallery/index.cfm?album=album&photo=44

Look like this:
/gallery/album/subalbum/44

My problem now is that some albums are pretty huge, so I'd like to add pagination. I wrote something to append ?page=1 to the end of the URL string, but that seems to "break" my setup.

Here are the rewrite rules I have now. Keep in mind that some albums have sub-albums (/album/sub-album/pic), and some just have pics (/album/pic)


Code:
RewriteRule gallery/(\w+)/$ /gallery/index.cfm?album=$1 [NC]
RewriteRule gallery/(\w+)$ /gallery/index.cfm?album=$1 [NC]

RewriteRule gallery/(\w+)/(\d+)$ /gallery/index.cfm?album=$1&photo=$2 [NC]
RewriteRule gallery/(\w+)/(\d+)/$ /gallery/index.cfm?album=$1&photo=$2 [NC]

RewriteRule gallery/(\w+)/(\w+)$ /gallery/index.cfm?album=$2 [NC]
RewriteRule gallery/(\w+)/(\w+)/$ /gallery/index.cfm?album=$2 [NC]

RewriteRule gallery/(\w+)/(\w+)/(\d+)$ /gallery/index.cfm?album=$2&photo=$3 [NC]
RewriteRule gallery/(\w+)/(\w+)/(\d+)/$ /gallery/index.cfm?album=$2&photo=$3 [NC]
This might look horrific to some of you, but I am a COMPLETE novice when it comes to Mod Rewrite.

I'm just not sure how to add an argument for &page=$ to the URL without breaking what's there now.