Fix file format query param issue

Based on the surrounding code this *looks* like a bug, in that I think it will generate a url query fragment `&format=pngpng` rather than `&format=png`.