Index: /trunk/src/org/expeditee/io/WebParser.java
===================================================================
--- /trunk/src/org/expeditee/io/WebParser.java	(revision 599)
+++ /trunk/src/org/expeditee/io/WebParser.java	(revision 600)
@@ -3,4 +3,5 @@
 import java.awt.Color;
 import java.awt.Font;
+import java.awt.Point;
 import java.awt.image.BufferedImage;
 import java.io.File;
@@ -179,64 +180,4 @@
 								// Checking if the element is actually visible on the page
 								if (WebParser.elementVisible(x, y, width, height, style)) {
-
-									// background image, returns in format "url(protocol://absolute/path/to/img.extension)" for images, may
-									// also return gradients, data, etc. (not handled yet)
-									String bgImage = (String) JavaFX.JSObjectCall.invoke(style, "getPropertyValue", new Object[] { "background-image" });
-
-									if (bgImage.startsWith("url(")) {
-
-										bgImage = bgImage.substring(4, bgImage.length() - 1);
-
-										String bgSize = ((String) JavaFX.JSObjectCall.invoke(style, "getPropertyValue", new Object[] { "background-size" })).toLowerCase();
-
-										// Returns "[x]px [y]px", "[x]% [y]%", "[x]px [y]%" or "[x]% [y]px"
-										String bgPosition = ((String) JavaFX.JSObjectCall.invoke(style, "getPropertyValue", new Object[] { "background-position" })).toLowerCase();
-
-										String[] bgOffsetCoords = bgPosition.split(" ");
-
-										int bgOffsetX = 0, bgOffsetY = 0;
-
-										int cropStartX, cropStartY, cropEndX, cropEndY;
-
-										// Converting the x and y offset values to integers (and from % to px if needed)
-										if (bgOffsetCoords[0].endsWith("%")) {
-											bgOffsetX = (int) ((Integer.valueOf(bgOffsetCoords[0].substring(0, bgOffsetCoords[0].length() - 1)) / 100.0) * width);
-										} else if (bgOffsetCoords[0].endsWith("px")) {
-											bgOffsetX = (int) (Integer.valueOf(bgOffsetCoords[0].substring(0, bgOffsetCoords[0].length() - 2)));
-										}
-
-										if (bgOffsetCoords[1].endsWith("%")) {
-											bgOffsetY = (int) ((Integer.valueOf(bgOffsetCoords[1].substring(0, bgOffsetCoords[1].length() - 1)) / 100.0) * height);
-										} else if (bgOffsetCoords[1].endsWith("px")) {
-											bgOffsetY = (int) (Integer.valueOf(bgOffsetCoords[1].substring(0, bgOffsetCoords[1].length() - 2)));
-										}
-
-										// Converting from an offset to crop coords
-										cropStartX = -1 * bgOffsetX;
-										cropEndX = (int) (cropStartX + width);
-
-										cropStartY = -1 * bgOffsetY;
-										cropEndY = (int) (cropStartY + height);
-
-										int bgWidth = -1;
-
-										if (bgSize.equals("cover")) {
-											bgWidth = (int) width;
-										} else if (bgSize.equals("contain")) {
-											// TODO: actually compute the appropriate width
-											bgWidth = (int) width;
-										} else if (bgSize.equals("auto")) {
-											bgWidth = -1;
-										} else {
-											bgWidth = Integer.parseInt(bgSize.split(" ")[0].replaceAll("\\D", ""));
-										}
-
-										try {
-											WebParser.addImageFromUrl(bgImage, frame, x, y, bgWidth, cropStartX, cropStartY, cropEndX, cropEndY);
-										} catch (MalformedURLException mue) {
-											// probably a 'data:' url, not supported yet
-											mue.printStackTrace();
-										}
-									}
 	
 									// Filtering the node type, starting with text nodes
@@ -333,4 +274,71 @@
 
 									} else if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
+
+										// background image, returns in format "url(protocol://absolute/path/to/img.extension)" for images,
+										// may also return gradients, data, etc. (not handled yet). Only need to add bg image on
+										// 'ELEMENT_NODE' (and not 'TEXT_NODE' otherwise there would be double-ups
+										String bgImage = (String) JavaFX.JSObjectCall.invoke(style, "getPropertyValue", new Object[] { "background-image" });
+
+										if (bgImage.startsWith("url(")) {
+
+											bgImage = bgImage.substring(4, bgImage.length() - 1);
+
+											String bgSize = ((String) JavaFX.JSObjectCall.invoke(style, "getPropertyValue", new Object[] { "background-size" })).toLowerCase();
+
+											// Returns "[x]px [y]px", "[x]% [y]%", "[x]px [y]%" or "[x]% [y]px"
+											String bgPosition = ((String) JavaFX.JSObjectCall.invoke(style, "getPropertyValue", new Object[] { "background-position" })).toLowerCase();
+
+											String[] bgOffsetCoords = bgPosition.split(" ");
+
+											int bgOffsetX = 0, bgOffsetY = 0;
+
+											int cropStartX, cropStartY, cropEndX, cropEndY;
+
+											// Converting the x and y offset values to integers (and from % to px if needed)
+											if (bgOffsetCoords[0].endsWith("%")) {
+												bgOffsetX = (int) ((Integer.valueOf(bgOffsetCoords[0].substring(0, bgOffsetCoords[0].length() - 1)) / 100.0) * width);
+											} else if (bgOffsetCoords[0].endsWith("px")) {
+												bgOffsetX = (int) (Integer.valueOf(bgOffsetCoords[0].substring(0, bgOffsetCoords[0].length() - 2)));
+											}
+
+											if (bgOffsetCoords[1].endsWith("%")) {
+												bgOffsetY = (int) ((Integer.valueOf(bgOffsetCoords[1].substring(0, bgOffsetCoords[1].length() - 1)) / 100.0) * height);
+											} else if (bgOffsetCoords[1].endsWith("px")) {
+												bgOffsetY = (int) (Integer.valueOf(bgOffsetCoords[1].substring(0, bgOffsetCoords[1].length() - 2)));
+											}
+
+											// Converting from an offset to crop coords
+											cropStartX = -1 * bgOffsetX;
+											cropEndX = (int) (cropStartX + width);
+
+											cropStartY = -1 * bgOffsetY;
+											cropEndY = (int) (cropStartY + height);
+
+											int bgWidth = -1;
+
+											if (bgSize.equals("cover")) {
+												bgWidth = (int) width;
+											} else if (bgSize.equals("contain")) {
+												// TODO: actually compute the appropriate width
+												bgWidth = (int) width;
+											} else if (bgSize.equals("auto")) {
+												bgWidth = -1;
+											} else {
+												bgSize = bgSize.split(" ")[0];
+
+												if (bgSize.endsWith("%")) {
+													bgWidth = (int) ((Integer.parseInt(bgSize.replaceAll("\\D", "")) / 100.0) * width);
+												} else if (bgSize.endsWith("px")) {
+													bgWidth = Integer.parseInt(bgSize.replaceAll("\\D", ""));
+												}
+											}
+
+											try {
+												WebParser.addImageFromUrl(bgImage, frame, x, y, bgWidth, cropStartX, cropStartY, cropEndX, cropEndY);
+											} catch (MalformedURLException mue) {
+												// probably a 'data:' url, not supported yet
+												mue.printStackTrace();
+											}
+										}
 
 										String imgSrc;
@@ -413,10 +421,14 @@
 	 *            Y-coordinate at which the image should be placed on the frame
 	 * @param width
-	 *            Width of the image once added to the frame, negative 1 (-1) will cause the actual width of the image file to be used
+	 *            Width of the image once added to the frame. Negative 1 (-1) will cause the actual width of the image file to be used
 	 * 
 	 * @param cropStartX
+	 *            X-coordinate at which to start crop, or null for no crop
 	 * @param cropStartY
+	 *            Y-coordinate at which to start crop, or null for no crop
 	 * @param cropEndX
+	 *            X-coordinate at which to end the crop, or null for no crop
 	 * @param cropEndY
+	 *            Y-coordinate at which to end the crop, or null for no crop
 	 * @throws MalformedURLException
 	 * @throws IOException
@@ -440,23 +452,21 @@
 		ImageIO.write(img, "png", out);
 
-		if (cropEndX != null && cropStartX != null && cropEndY != null && cropStartY != null) {
-			width = cropEndX - cropStartX;
-		} else {
+		if (cropEndX == null || cropStartX == null || cropEndY == null || cropStartY == null) {
 			cropStartX = 0;
 			cropStartY = 0;
 			cropEndX = img.getWidth();
 			cropEndY = img.getHeight();
-
-			if (width < 0) {
-				width = img.getWidth();
-			}
-		}
-
-		Text item = new Text(ItemUtils.GetTag(ItemUtils.TAG_IMAGE) + ":" + out.getPath() + " " + ((width >= 0) ? width : img.getWidth()) + " " + cropStartX + " " + cropStartY
-				+ " " + cropEndX + " " + cropEndY);
-
-		item.setPosition(x, y);
-
-		Picture pic = ItemUtils.CreatePicture(item, frame);
+		}
+
+		if (width < 0) {
+			width = img.getWidth();
+		}
+
+		Picture pic = new Picture(out.getName(), frame);
+		pic.setWidth(width);
+
+		// Have to divide the crop coords by the image scale, since Expeditee seems to always crop then scale
+		pic.setCropStart(new Point((int) (cropStartX / pic.getScale()), (int) (cropStartY / pic.getScale())));
+		pic.setCropEnd(new Point((int) (cropEndX / pic.getScale()), (int) (cropEndY / pic.getScale())));
 		pic.setPosition(x, y);
 		frame.addItem(pic);
Index: /trunk/src/org/expeditee/items/ItemUtils.java
===================================================================
--- /trunk/src/org/expeditee/items/ItemUtils.java	(revision 599)
+++ /trunk/src/org/expeditee/items/ItemUtils.java	(revision 600)
@@ -367,39 +367,4 @@
 			}
 
-			// try images subdirectory
-			File file = null;
-
-			for (String dir : org.expeditee.settings.UserSettings.ImageDirs) {
-				file = new File(dir + path);
-				if (file.exists() && !file.isDirectory())
-					break;
-			}
-
-			if (file == null || !file.exists() || file.isDirectory())
-				file = new File(path);
-
-			// try relative path
-			if (!file.exists() || file.isDirectory()) {
-				URL picture = new Object().getClass().getResource(path);
-
-				// decode to remove %20 in windows folder names
-				if (picture != null) {
-					try {
-						path = URLDecoder.decode(picture.getFile(), "UTF-8");
-					} catch (UnsupportedEncodingException e) {
-						// TODO Auto-generated catch block
-						e.printStackTrace();
-					}
-				}
-
-			} else
-				path = file.getPath();
-
-			// if the image isn't found by now, give up.
-			file = new File(path);
-			if (!file.exists() || file.isDirectory()) {
-				return null;
-			}
-
 		} catch (Exception e) {
 			return null;
Index: /trunk/src/org/expeditee/items/Picture.java
===================================================================
--- /trunk/src/org/expeditee/items/Picture.java	(revision 599)
+++ /trunk/src/org/expeditee/items/Picture.java	(revision 600)
@@ -17,5 +17,7 @@
 import java.awt.image.ImageObserver;
 import java.io.File;
+import java.io.UnsupportedEncodingException;
 import java.net.URL;
+import java.net.URLDecoder;
 
 import javax.imageio.ImageIO;
@@ -138,7 +140,4 @@
 	 */
 	protected void parseSize(String size) {
-		
-		System.out.println("Size: " + size);
-
 		// don't check this anymore since it's only called from constructors now
 		// if (_end.x != 0 || _end.y != 0)
@@ -582,4 +581,41 @@
 
 	public boolean refresh() {
+		// try images subdirectory
+		File file = null;
+
+		for (String dir : org.expeditee.settings.UserSettings.ImageDirs) {
+			file = new File(dir + _path);
+			if (file.exists() && !file.isDirectory())
+				break;
+		}
+
+		if (file == null || !file.exists() || file.isDirectory())
+			file = new File(_path);
+
+		// try relative path
+		if (!file.exists() || file.isDirectory()) {
+			URL picture = new Object().getClass().getResource(_path);
+
+			// decode to remove %20 in windows folder names
+			if (picture != null) {
+				try {
+					_path = URLDecoder.decode(picture.getFile(), "UTF-8");
+				} catch (UnsupportedEncodingException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+
+		} else
+			_path = file.getPath();
+
+		// if the image isn't found by now, give up.
+		file = new File(_path);
+		if (!file.exists() || file.isDirectory()) {
+			// If the image could not be read
+			_image = imageNotFound;
+			return false;
+		}
+
 		// ImageIcon is faster, but cannot handle some formats
 		// (notably.bmp) hence, we try this first, then if it fails we try
@@ -676,5 +712,4 @@
 	public Integer getWidthToSave() {
 		if(_scaleType == WIDTH) {
-			System.out.println(this.getWidth());
 			return this.getWidth();
 		}
