Index: src/wp-includes/media.php
===================================================================
--- src/wp-includes/media.php	(revision 27913)
+++ src/wp-includes/media.php	(working copy)
@@ -992,11 +992,11 @@
 				</{$captiontag}>";
 		}
 		$output .= "</{$itemtag}>";
-		if ( $columns > 0 && ++$i % $columns == 0 )
+		if ( ! $html5 && $columns > 0 && ++$i % $columns == 0 )
 			$output .= '<br style="clear: both" />';
 	}
 
-	if ( $columns > 0 && $i % $columns !== 0 ) {
+	if ( ! $html5 && $columns > 0 && $i % $columns !== 0 ) {
 		$output .= "
 			<br style='clear: both' />";
 	}
Index: src/wp-content/themes/twentyfourteen/style.css
===================================================================
--- src/wp-content/themes/twentyfourteen/style.css	(revision 27913)
+++ src/wp-content/themes/twentyfourteen/style.css	(working copy)
@@ -753,6 +753,8 @@
 .footer-sidebar:after,
 .hentry:before,
 .hentry:after,
+.gallery:before,
+.gallery:after,
 .slider-direction-nav:before,
 .slider-direction-nav:after,
 .contributor-info:before,
@@ -769,6 +771,7 @@
 
 .footer-sidebar:after,
 .hentry:after,
+.gallery:after,
 .slider-direction-nav:after,
 .contributor-info:after,
 .search-box:after,
@@ -1489,6 +1492,13 @@
 	margin-right: 0;
 }
 
+.gallery-columns-1.gallery-size-medium figure.gallery-item:nth-of-type(1n+1),
+.gallery-columns-1.gallery-size-thumbnail figure.gallery-item:nth-of-type(1n+1),
+.gallery-columns-2.gallery-size-thumbnail figure.gallery-item:nth-of-type(2n+1),
+.gallery-columns-3.gallery-size-thumbnail figure.gallery-item:nth-of-type(3n+1) {
+	clear: left;
+}
+
 .gallery-caption {
 	background-color: rgba(0, 0, 0, 0.7);
 	-webkit-box-sizing: border-box;
Index: src/wp-content/themes/twentythirteen/style.css
===================================================================
--- src/wp-content/themes/twentythirteen/style.css	(revision 27913)
+++ src/wp-content/themes/twentythirteen/style.css	(working copy)
@@ -1324,6 +1324,13 @@
 	margin-right: 0;
 }
 
+.gallery-columns-1.gallery-size-medium figure.gallery-item:nth-of-type(1n+1),
+.gallery-columns-1.gallery-size-thumbnail figure.gallery-item:nth-of-type(1n+1),
+.gallery-columns-2.gallery-size-thumbnail figure.gallery-item:nth-of-type(2n+1),
+.gallery-columns-3.gallery-size-thumbnail figure.gallery-item:nth-of-type(3n+1) {
+	clear: left;
+}
+
 .gallery-caption {
 	background-color: rgba(0, 0, 0, 0.7);
 	box-sizing: border-box;
