Thread:Project:Support desk/Forcing new line in templates (2)

I'm going to standardize some picture galleries at some non-public wiki using pure templates. The legacy wiki picture/thumbnail galleries are specified with a lot of boilerplate code (it renders a gallery of pictures with thumbnails underneath):

This is scary. There is an idea of re-implementing the above code with the following template:

The template is mostly as follows:

... var definitions, etc ...

But the problem is that only the first image is rendered, and the whole rest _Picture 2... Picture 7_ is rendered under the first image thumbnail. And I suspect that the reason possibly is a missing new line character so the gallery tag may be rendered like this producing wrong 1-picture gallery:

 Image:Pic1.jpg| 1 Image:Pic2.jpg| 2 Image:Pic3.jpg| 3 ...

It's only an assumption, but I guess it may have strong background. So the question is: is there any way of forcing a new line break so the &lt;gallery&gt; tag could be rendered as expected?

Thanks!