Fixed gallery layout bug

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**