diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 79bd1a9..33f0a17 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -1764,6 +1764,64 @@ jQuery(function($){
 		</select>
 	</td>
 	</tr>
+		<tr>
+		<th scope="row" class="label">
+			<label>
+			<span class="alignleft"><?php _e('Image Size:'); ?></span>
+			</label>
+		</th>
+		<td class="field">
+			<select id="image_size" name="image_size" size="1">
+				<?php $sizes =  get_intermediate_image_sizes();
+				foreach ($sizes as $size) : ?>
+					<option value="<?php echo $size?>"><?php echo _e( ucfirst( $size ) ); ?></option>
+				<?php endforeach; ?>
+			</select>
+		</td>
+	</tr>
+	<tr>
+		<th scope="row" class="label">
+			<label>
+			<span class="alignleft"><?php _e('Display:'); ?></span>
+			</label>
+		</th>
+		<td class="field">
+			<input type="radio" checked="checked" name="display" id="display-all" value="all" />
+			<label for="display-all" class="radio"><?php _e('All'); ?></label>
+	
+			<input type="radio" name="display" id="display-include" value="include" />
+			<label for="display-include" class="radio"><?php _e('Include'); ?></label>
+			
+			<input type="radio" name="display" id="display-exclude" value="exclude" />
+			<label for="display-exclude" class="radio"><?php _e('Exclude'); ?></label>
+			<div id="gallery_ids_wrapper" style="display:none;" >
+				<?php 
+				$attachments = array();
+				if ( $post_id ) {
+					$post = get_post($post_id);
+					if ( $post && $post->post_type == 'attachment' )
+						$attachments = array($post->ID => $post);
+					else
+						$attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') );
+				} else {
+					if ( is_array($GLOBALS['wp_the_query']->posts) )
+						foreach ( $GLOBALS['wp_the_query']->posts as $attachment )
+						$attachments[$attachment->ID] = $attachment;
+				}
+				
+				$output = '';
+				foreach ( (array) $attachments as $id => $attachment ) {
+					if ( $attachment->post_status == 'trash' )
+						continue;
+					if (TRUE == ( $title = get_the_title($id) ) )
+						$output .= '<span style="float:left;"><input type="checkbox" name="gallery_ids['. $id .']" class="gallery_ids" id="gallery_id'. $id .'">';
+						$output .= '<label for="gallery_id' . $id . '">' . $title . '</label></span>';
+				}
+				?>
+				<?php echo $output; ?>
+			</div>
+		</td>
+	</tr>
 </tbody></table>
 
 <p class="ml-submit">
diff --git a/wp-admin/js/gallery.dev.js b/wp-admin/js/gallery.dev.js
index d7b4bb1..5d73e3a 100644
--- a/wp-admin/js/gallery.dev.js
+++ b/wp-admin/js/gallery.dev.js
@@ -67,6 +67,17 @@ jQuery(document).ready(function($) {
 			$('#insert-gallery').show();
 		}
 	}
+	//Setup the display options chooser
+	$("input[name=display]").click(function  (e) {
+		var $target = $(e.target),
+		val = $target.val(),
+		$id_wrapper = $("#gallery_ids_wrapper");
+		if (val == "include" || val == "exclude") {
+			$id_wrapper.slideDown(); 
+		} else {
+			$id_wrapper.slideUp(); 
+		}
+	});
 });
 
 jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup
@@ -122,10 +133,12 @@ wpgallery = {
 			if ( (g = ed.dom.select('img.wpGallery')) && g[0] ) {
 				t.el = g[0];
 			} else {
+				//Set current options
 				if ( getUserSetting('galfile') == '1' ) t.I('linkto-file').checked = "checked";
 				if ( getUserSetting('galdesc') == '1' ) t.I('order-desc').checked = "checked";
 				if ( getUserSetting('galcols') ) t.I('columns').value = getUserSetting('galcols');
 				if ( getUserSetting('galord') ) t.I('orderby').value = getUserSetting('galord');
+				
 				jQuery('#insert-gallery').show();
 				return;
 			}
@@ -135,6 +148,8 @@ wpgallery = {
 		a = ed.dom.decode(a);
 
 		if ( a ) {
+			//There is already a gallery in the selection
+			//Update the UI to reflect the current shortcode
 			jQuery('#update-gallery').show();
 			t.is_update = true;
 
@@ -142,11 +157,34 @@ wpgallery = {
 			link = a.match(/link=['"]([^'"]+)['"]/i);
 			order = a.match(/order=['"]([^'"]+)['"]/i);
 			orderby = a.match(/orderby=['"]([^'"]+)['"]/i);
+			
+			include = a.match(/include=['"]([^'"]+)['"]/i);
+			exclude = a.match(/exclude=['"]([^'"]+)['"]/i);
+			size = a.match(/size=['"]([^'"]+)['"]/i);
 
 			if ( link && link[1] ) t.I('linkto-file').checked = "checked";
 			if ( order && order[1] ) t.I('order-desc').checked = "checked";
 			if ( columns && columns[1] ) t.I('columns').value = ''+columns[1];
 			if ( orderby && orderby[1] ) t.I('orderby').value = orderby[1];
+			if ( size && size[1] ) t.I('image_size').value = size[1];
+
+			
+			if (include || exclude )
+				jQuery("#gallery_ids_wrapper").show();
+			if (include && include[1]) {
+				var ids = include[1].split(',');
+				jQuery.each(ids, function (k,v) {
+					jQuery("#gallery_id"+v).attr('checked','checked');
+				})
+				jQuery('#display-include').trigger('click')
+			}
+			if (exclude && exclude[1]) {
+				var ids = exclude[1].split(',');
+				jQuery.each(ids, function (k,v) {
+					jQuery("#gallery_id"+v).attr('checked','checked');
+				})
+				jQuery('#display-exclude').trigger('click')
+			}
 		} else {
 			jQuery('#insert-gallery').show();
 		}
@@ -164,7 +202,9 @@ wpgallery = {
 		if (t.el.nodeName != 'IMG') return;
 
 		all = ed.dom.decode(ed.dom.getAttrib(t.el, 'title'));
-		all = all.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi, '');
+		//Remove original shortcode options
+		all = all.replace(/\s*(order|link|columns|orderby|include|exclude|size)=['"]([^'"]+)['"]/gi, '');
+		//Get the new settings
 		all += t.getSettings();
 
 		ed.dom.setAttrib(t.el, 'title', all);
@@ -172,8 +212,9 @@ wpgallery = {
 	},
 
 	getSettings : function() {
-		var I = this.I, s = '';
-
+		var I = this.I, //document.GetElementbyID 
+		s = '', //Shortcode Setting String (returned);
+		ids = [];//Attachment ids for include/exclude
 		if ( I('linkto-file').checked ) {
 			s += ' link="file"';
 			setUserSetting('galfile', '1');
@@ -188,12 +229,39 @@ wpgallery = {
 			s += ' columns="'+I('columns').value+'"';
 			setUserSetting('galcols', I('columns').value);
 		}
-
-		if ( I('orderby').value != 'menu_order' ) {
-			s += ' orderby="'+I('orderby').value+'"';
-			setUserSetting('galord', I('orderby').value);
+		if ( I('image_size').value != 'thumbnail' ) {
+			s += ' size="'+I('image_size').value+'"';
+			setUserSetting('galimage_size', I('image_size').value);
+		}
+		if (! I('display-all').checked ) { 
+			//We're filtering the result set for an include/exclude
+			var $ids = jQuery(".gallery_ids");//jQuery array
+			jQuery.each($ids, function  (k,checkbox) {
+				if (checkbox.checked) {
+					//cache the attachment ids to include/exclude
+					ids[k] = checkbox.id.replace('gallery_id','');//Get the numeric id
+				}
+			});
+		}
+		if ( I('display-all').checked ) {
+			setUserSetting('galdisplay', 'all');
+		} else if ( I('display-include').checked ) {
+			//Gallery Shortcode Include
+			if (! ids.length == 0 ) 
+			{
+				s += ' include="'+ ids.join(',') + '"';
+				setUserSetting('galdisplay', 'include=' + ids.join(',') );
+				
+			}
+		} else if ( I('display-exclude').checked ){
+			//Gallery Shortcode Exclude
+			if (! ids.length == 0 ) 
+			{
+				s += ' exclude="'+ ids.join(',') + '"';
+				setUserSetting('galdisplay', 'exclude=' + ids.join(',') );
+			}
 		}
 
 		return s;
 	}
-};
+};
\ No newline at end of file
