Index: /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js	(revision 2818)
+++ /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js	(revision 2819)
@@ -38,5 +38,5 @@
 			return 0;
 
-		if ( input.isChanged() || ( dialog.editMode[ object ] == false && input.getValue() != '' ))
+		if ( input.getValue() != '' || input.isChanged() )
 		{
 			dialog.changedAttibutes[ object ][ name ] = input.getValue();
@@ -147,6 +147,7 @@
 		var vspace = dialog.getValueOf( 'info', 'txtVSpace' );
 		var align = dialog.getValueOf( 'info', 'cmbAlign' );
-		var title = dialog.getValueOf( 'info', 'txtTitle' );
-		
+		var alt = dialog.getValueOf( 'info', 'txtAlt' );
+		var title = dialog.getValueOf( 'advanced', 'txtGenTitle' );
+
 		// Validate values
 		border = parseInt( border, 10 );
@@ -164,6 +165,7 @@
 
 		dialog.editObj[ 'imagePreview' ].setAttribute( 'align', align );
-		dialog.editObj[ 'imagePreview' ].setAttribute( 'align', title );
-
+		dialog.editObj[ 'imagePreview' ].setAttribute( 'title', title );
+		dialog.editObj[ 'imagePreview' ].setAttribute( 'alt', alt );
+		
 		dialog.editObj[ 'imagePreview' ].setStyle( 'border', border + 'px solid black' );
 		dialog.editObj[ 'imagePreview' ].setStyle( 'margin-top', vspace + 'px' );
@@ -248,5 +250,8 @@
 				// % is allowed.
 				if ( aMatchH[2] == '%' )
+				{
 					aMatchH[1] += '%';
+					switchLockRatio( dialog, false );	// Unlock ratio
+				}
 				heightText = aMatchH[1];
 			}
@@ -261,5 +266,8 @@
 				// % is allowed.
 				if ( aMatchW[2] == '%' )
+				{
 					aMatchW[1] += '%';
+					switchLockRatio( dialog, false );	// Unlock ratio
+				}
 				widthText = aMatchW[1];
 			}
@@ -304,6 +312,9 @@
 				if ( childTagName == 'img' || childTagName == 'input' )
 				{
-					this.editMode[ 'image' ] = true;
 					this.editObj[ 'image' ] = linkChildren.getItem( 0 );
+					if ( this.editObj[ 'image' ].$.tagName.toLowerCase() == 'img' )
+						this.editMode[ 'image' ] = 'img';
+					else if ( this.editObj[ 'image' ].$.tagName.toLowerCase() == 'input' )
+						this.editMode[ 'image' ] = 'input';
 				}
 			}
@@ -318,7 +329,11 @@
 		}
 
-		if ( element.$.tagName.toLowerCase() == 'img' || element.$.tagName.toLowerCase() == 'input' || this.editObj[ 'image' ] )
-		{
-			this.editMode[ 'image' ] = true;
+		if ( element.$.tagName.toLowerCase() == 'img' )
+			this.editMode[ 'image' ] = 'img';
+		else if ( element.$.tagName.toLowerCase() == 'input' )
+			this.editMode[ 'image' ] = 'input';
+
+		if ( this.editMode[ 'image' ] || this.editObj[ 'image' ] )
+		{
 			if ( !this.editObj[ 'image' ] )
 				this.editObj[ 'image' ] = element;
@@ -651,5 +666,5 @@
 						onChange : function()
 						{
-							onChange( this, 'title' );
+							onChange( this, 'alt' );
 						},
 						validate: function()
@@ -988,4 +1003,8 @@
 								id : 'txtGenTitle',
 								label : editor.lang.dlgGenTitle,
+								onChange : function()
+								{
+									onChange( this, 'title' );
+								},
 								validate : function()
 								{
