Allow small inventory grids to shrink further

When inventory grids do not have cell counts up to the maximum horizontal cells, it still uses the maxHorizontalCells to calculate the content width.  This can cause more dynamic layouts to expand much wider than expected and run out of space.