urlencode for placeholders

Placeholders should be urlencoded, because $base_url is also urlencoded. So $base_url may look like this:
.../statistics/image/%25key/%25mode/%25image_number
Merge pull request #273 from milkyway-git/patch-2

placeholders urlencoded