Rewrite to put image loading into a pipeline, and in z-index order, ready for rendering to canvas.