public void propertyChange(PropertyChangeEvent e) {
        String propertyName = e.getPropertyName();
        
        // Make sure we are responding to the right event.
        if (propertyName.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) {
            File selection = (File)e.getNewValue();
            String name;
            
            if (selection == null)
                return;
            else
                name = selection.getAbsolutePath();
            
            /*
             * Make reasonably sure we have an image format that AWT can
             * handle so we don't try to draw something silly.
             */
            if (name != null) {
            	String nameLower = name.toLowerCase();
            	if (nameLower.endsWith(".jpg") ||
            			nameLower.endsWith(".jpeg") ||
            			nameLower.endsWith(".gif")) { //TODO: Put this in a separate method, and the types in a list. Make it easily extendable. See pictureFetcher.isValidFileExtendsion
            		icon = new ImageIcon(name);
            		image = icon.getImage();
            		scaleImage();
            		repaint();
            	}
            }
        }
    }