Fixed gallery layout bug #814

Fixes bug that I introduced last week with galleries showing 40px of the next image on the screen.

Lesson learnt: **Never hack the third-party library**