fixed grid Dynamic resizing

Can handle primes and larger numbers.
Scales correctly with the screen (top scales first sub the number that
are missing from the grid config).