scale image width relative to view port width

Signed-off-by: Florian Thienel <florian@thienel.org>
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Image.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Image.java
index 592c925..9a0623e 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Image.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Image.java
@@ -195,7 +195,7 @@
 	}
 
 	private Point calculateActualDimensions() {
-		final int width = preferredWidth == null ? 0 : preferredWidth.get(image.getWidth());
+		final int width = preferredWidth == null ? 0 : preferredWidth.get(maxWidth);
 		final int height = preferredHeight == null ? 0 : preferredHeight.get(image.getHeight());
 		if (width != 0 && height != 0) {
 			return new Point(width, height);