Refines Packery logic and fixes some bugs in grid-sizing.js