That demo website is being created with our standalone version of the theme which is sold for use on self-hosted WordPress installs. It’s not the exact same as the one on .com and some things there may not be possible on .com accounts.
The gallery with a lightbox on that page is added using the Jetpack plugin.
I don’t think you can edit any PHP files with a WordPress.com account. You’ll have to ask a WordPress support person if this is possible.