Fix image file being left open
Merge pull request #1 from kaeza/patch-1

Fix image file being left open