Heavily based on http://tympanus.net/codrops/2014/03/21/google-grid-gallery/