Refactors calculateItemsForRow() allowing items with weird sizes