First, thank you for sharing this great solution with us! it's what I've been needing, but I'm unable to implement, unfortunately. I've read through the thread here several times, recreated your implementation down to the letter ( I think), but am unable to get this thing to properly work.
I would greatly appreciate your help - or anyone else's - to point me in the right direction here.
Here's the link to the media gallery as is stands, published;
Here's the "hidden page", the purpose of which I don't understand and can't find the equivalent on your demo site:
Here's the designer read-only Link: