Create layout.js

Calculates the coordinates for the images and sends them to the index to be displayed.