Sorry about my original description, but viewing the photo doesn't give me a problem, so I know the rewrite works, it's just the popup link.
So I have a live demo of what I'm talking about, using your template. It's at:
You'll see that the (unstyled) comment popup works for the most recent photo, and the SEF URLs work for browsing. But the comment popup won't work for anything but the latest (ie., anything under the /p/# scheme).
I hope that will help to explain the problem.
I'd really love to get this fixed! Any insight you have would be epic. Thanks so much for checking it out!