Updated JavaScript to trunctate titles that are too long for gallery homepage. Fixes #1