make paintlines and paintsquiggles keep track of each layer, so that it will be possible to save to multipage tiff or xcf