Added heuristic for determining cell size

The optimalTileHeight/Width are now expanded (left to right, then top to
bottom) up to a maximum of 2MB, or one complete XY plane.