Fix a bug; add a test for it.
Merge pull request #28 from weykent/fix-appending-to-images

Fix appending to images