Image save fix

Fixes #47.