Index: package-lock.json
===================================================================
--- package-lock.json	(revision 44476)
+++ package-lock.json	(working copy)
@@ -11128,7 +11128,7 @@
 		},
 		"onetime": {
 			"version": "1.1.0",
-			"resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
+			"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
 			"integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
 			"dev": true
 		},
Index: src/wp-includes/widgets/class-wp-widget-media-image.php
===================================================================
--- src/wp-includes/widgets/class-wp-widget-media-image.php	(revision 44476)
+++ src/wp-includes/widgets/class-wp-widget-media-image.php	(working copy)
@@ -67,7 +67,7 @@
 				'size'              => array(
 					'type'        => 'string',
 					'enum'        => array_merge( get_intermediate_image_sizes(), array( 'full', 'custom' ) ),
-					'default'     => 'medium',
+					'default'     => get_option( 'image_default_size', 'medium' ),
 					'description' => __( 'Size' ),
 				),
 				'width'             => array( // Via 'customWidth', only when size=custom; otherwise via 'width'.
Index: tests/phpunit/tests/query/taxQuery.php
===================================================================
--- tests/phpunit/tests/query/taxQuery.php	(revision 44476)
+++ tests/phpunit/tests/query/taxQuery.php	(working copy)
@@ -434,6 +434,78 @@
 	}
 
 	/**
+	 * @ticket 39140
+	 */
+	public function test_tax_query_single_query_multiple_hierarchical_terms_operator_and() {
+		$europe = self::factory()->term->create(
+			array(
+				'taxonomy' => 'category',
+				'name'     => 'Europe',
+			)
+		);
+		$spain = self::factory()->term->create(
+			array(
+				'taxonomy' => 'category',
+				'name'     => 'Spain',
+				'parent'   => $europe,
+			)
+		);
+		$south_america = self::factory()->term->create(
+			array(
+				'taxonomy' => 'category',
+				'name'     => 'South America',
+			)
+		);
+		$argentina = self::factory()->term->create(
+			array(
+				'taxonomy' => 'category',
+				'name'     => 'Argentina',
+				'parent'   => $south_america,
+			)
+		);
+		$post_a = self::factory()->post->create( array( 'post_category' => array( $argentina ) ) );
+		$post_b = self::factory()->post->create( array( 'post_category' => array( $spain ) ) );
+		$post_c = self::factory()->post->create( array( 'post_category' => array( $argentina, $spain ) ) );
+
+		$posts = get_posts(
+			array(
+				'fields'                 => 'ids',
+				'update_post_meta_cache' => false,
+				'update_post_term_cache' => false,
+				'tax_query'              => array(
+					array(
+						'taxonomy' => 'category',
+						'field'    => 'id',
+						'terms'    => array( $argentina, $spain ),
+						'operator' => 'AND'
+					),
+				),
+			)
+		);
+
+		$this->assertEquals( 1, count( $posts ) );
+
+		$posts = get_posts(
+			array(
+				'fields'                 => 'ids',
+				'update_post_meta_cache' => false,
+				'update_post_term_cache' => false,
+				'tax_query'              => array(
+					array(
+						'taxonomy' => 'category',
+						'field'    => 'id',
+						'terms'    => array( $europe, $south_america ),
+						'operator' => 'AND'
+					),
+				),
+			)
+		);
+
+		$this->assertEquals( 1, count( $posts ) );
+
+	}
+
+	/**
 	 * @ticket 29181
 	 */
 	public function test_tax_query_operator_not_exists() {
