always force sheets to be square.
correctly calculate sheet dimensions (was chopping off the bottom row).