Ensure computeLayout returns sane values when itemsPerRow is 0 (including test)