Image lightbox fix

cc @mattosborn 

Now using a regex
Yep, at the moment galleries are using unprefixed numbers as image IDs, so part of this pull request is to prefix all of those with img-. In the short term we want it to be optional so we don't break links already in the wild.