Infinite scrolling for gallery + seamless layout

This is a work in progress of @icewind1991 regarding https://github.com/owncloud/gallery/issues/5 and a successor of my seamless layout in https://github.com/owncloud/gallery/pull/17