Fixes deserialization issue occurring in Firefox 11 and Safari 5.

These browsers encode '~' into '%7E' and as a result Dragonfly can't find the image.

This commit fixes the bug and includes a test case.