diff --git a/src/SingleView.cs b/src/SingleView.cs
index 650fc5a..cb06b2c 100644
--- a/src/SingleView.cs
+++ b/src/SingleView.cs
@@ -541,8 +541,14 @@ namespace FSpot {
 
 			case Preferences.VIEWER_WIDTH:
 			case Preferences.VIEWER_HEIGHT:
-				window.SetDefaultSize(Preferences.Get<int> (Preferences.VIEWER_WIDTH),
-						      Preferences.Get<int> (Preferences.VIEWER_HEIGHT));
+				int width, height;
+				width = Preferences.Get<int> (Preferences.VIEWER_WIDTH);
+				height = Preferences.Get<int> (Preferences.VIEWER_HEIGHT);
+
+				if( width == 0 || height == 0 )
+					break;
+
+				window.SetDefaultSize(width, height);
 
 				window.ReshowWithInitialSize();
 				break;
