bugfix: properly exit after saving PNG image