Basic code for the image saving process. Super ugly, no client-side code
added in yet.