Separate canvases into frames (JS)