Calculate width and height automatically
Currently, the entrance layer and the template layers need explicit properties denoting their width and height, so the code positioning the copied layers knows how much to add to the offsets.
The code should instead determine width and height from the contained tiles.