Index: /CKEditor/branches/features/bbcode/_source/plugins/image/dialogs/image.js
===================================================================
--- /CKEditor/branches/features/bbcode/_source/plugins/image/dialogs/image.js	(revision 6691)
+++ /CKEditor/branches/features/bbcode/_source/plugins/image/dialogs/image.js	(revision 6692)
@@ -116,4 +116,7 @@
 		var switchLockRatio = function( dialog, value )
 		{
+			if ( !dialog.getContentElement( 'info', 'ratioLock' ) )
+				return;
+
 			var oImageOriginal = dialog.originalElement;
 
@@ -169,6 +172,8 @@
 			if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
 			{
-				dialog.setValueOf( 'info', 'txtWidth', oImageOriginal.$.width );
-				dialog.setValueOf( 'info', 'txtHeight', oImageOriginal.$.height );
+				var widthField = dialog.getContentElement( 'info', 'txtWidth' ),
+					heightField = dialog.getContentElement( 'info', 'txtHeight' );
+				widthField && widthField.setValue( oImageOriginal.$.width );
+				heightField && heightField.setValue( oImageOriginal.$.height );
 			}
 			updatePreview( dialog );
@@ -450,6 +455,10 @@
 					this.hidePage( 'Link' );		//Hide Link tab.
 				var doc = this._.element.getDocument();
-				this.addFocusable( doc.getById( btnResetSizeId ), 5 );
-				this.addFocusable( doc.getById( btnLockSizesId ), 5 );
+
+				if ( this.getContentElement( 'info', 'ratioLock' ) )
+				{
+					this.addFocusable( doc.getById( btnResetSizeId ), 5 );
+					this.addFocusable( doc.getById( btnLockSizesId ), 5 );
+				}
 
 				this.commitContent = commitContent;
@@ -726,4 +735,5 @@
 												},
 												{
+													id : 'ratioLock',
 													type : 'html',
 													style : 'margin-top:30px;width:40px;height:40px;',
