Fix broken temporary download image URLs in blogposts caused by a combination of bugs.
Firstly, an over-enthusiastic optimisation I was responsible for broke the replacement of downloadtemp images, especially on sites which are not installed at the root of a domain. Then, some greedy regexes meant that if there was more than one image in the post, only one of them would have the URL fixed properly. The same bug was happening again when posts were being displayed in views. This patch fixes these problems, and contains a blog database upgrade to fix existing broken paths.