What happens:
When using a gallery at the beginning of a comment on a talk page, apparently a span data-mw-comment-start with an anchor id is added inside the gallery, which causes the first image to have a larger top-margin. See the examples on dewiki, where it was first reported.
What should happen:
The span should instead be added before the gallery.