Index: custom-header.php
===================================================================
--- custom-header.php	(revision 18487)
+++ custom-header.php	(working copy)
@@ -416,13 +416,15 @@
 		var ximg = jQuery('img#upload').width();
 		var yimg = jQuery('img#upload').height();
 
-		if ( yimg < yinit || ximg < xinit ) {
-			if ( ximg / yimg > ratio ) {
-				yinit = yimg;
-				xinit = yinit * ratio;
-			} else {
-				xinit = ximg;
-				yinit = xinit / ratio;
+		if (yimg > yint) && (ximg > xinit) {
+			if ( yimg < yinit || ximg < xinit ) {
+				if ( ximg / yimg > ratio ) {
+					yinit = yimg;
+					xinit = yinit * ratio;
+				} else {
+					xinit = ximg;
+					yinit = xinit / ratio;
+				}
 			}
 		}
 
@@ -484,7 +486,7 @@
 	  call_user_func( $this->admin_image_div_callback );
 	} else {
 	?>
-	<div id="headimg" style="max-width:<?php echo HEADER_IMAGE_WIDTH; ?>px;height:<?php echo HEADER_IMAGE_HEIGHT; ?>px;background-image:url(<?php esc_url ( header_image() ) ?>);">
+	<div id="headimg" style="max-width:<?php echo HEADER_IMAGE_WIDTH; ?>px;height:<?php echo HEADER_IMAGE_HEIGHT; ?>px;background:url(<?php esc_url ( header_image() ) ?>) top left no-repeat;">
 		<?php
 		if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) || '' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) || ! $this->header_text() )
 			$style = ' style="display:none;"';
@@ -654,7 +656,7 @@
 
 		list($width, $height, $type, $attr) = getimagesize( $file );
 
-		if ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) {
+		if ( ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) || ( ( $width < HEADER_IMAGE_WIDTH && $height < HEADER_IMAGE_HEIGHT ) ) ) {
 			// Add the meta-data
 			wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
 			update_post_meta( $id, '_wp_attachment_is_custom_header', get_option('stylesheet' ) );
