Added a layout template to avoid repeating code.
Got rid of hard coded image0,   so now you can
specify more than one image in the layers param