abandon gallery if there are no slides
Merge pull request #665 from lonelyplanet/chee-fix-js-errrr

Tiny PR that fixes that error in gallery