Make saving of images work.

Use png instead of jpg, seem to be bumping against a jpg bug in ImageIO.