Fixed things

Accidentally edited before a commit. Now the stuff actually works
rather than giving an error.
All the things have been done to the PHP

The script will create a config based on the users layout request and
the number of time streams that it is given.
It can handle primes, odd numbers, square numbers and I have tested it
up to 64 streams (without any actual images though).