fix the image encoding problem

explained in #28; the key is to apply `URLencode()` to src