It has been around sometime, but currently the CSS style for the gallery widget is not quite right.
See the attached photo for an explanation. The style for the <ul> element is malfunctioning, which causes a 1.6em left margin (and a 0.3em top margin) that makes each <li> tag (namely, each image) to misalign.
I have looked into this problem half a year ago and found out that the supposed style for this element ( ul.gallery ) was overridden by another style ( .mw-content-rtl ul ). The former was loaded by "mediawiki.page.gallery.styles", and the latter was loaded by "skins.vector.styles.legacy" ( as well as the new desktop design "skins.vector.styles" ). These two CSS selectors have the same specificity, and since the "skins.vector.styles.legacy" is loaded after "mediawiki.page.gallery.styles", the ".mw-content-rtl ul" rule is used.
For a clear view of the impact of this problem, w:zh:WP:每日图片 shows how every image, when inside a table cell, violates the cell bounds.