cut out old code from console-only version. change file extension for images to SVG.