Changing the background image in all spaces
desktop 1 seems to be the currently selected space, so you might use a hack like this:

set f to POSIX file "/Library/Desktop Pictures/Beach.jpg"
tell application "System Events"
    repeat 4 times
        key code 123 using control down -- 123 is left arrow
    end repeat
    repeat 4 times
        set picture of desktop 1 to f
        key code 124 using control down -- 124 is right arrow
    end repeat
end tell


The entries in ~/Library/Preferences/com.apple.desktop.plist look like this:

default =                 {
    BackgroundColor =                     (
        0,
        0,
        0
    );
    Change = Never;
    ChangePath = "/Library/Desktop Pictures";
    ChangeTime = 1800;
    DrawBackgroundColor = 1;
    ImageFileAlias = &lt;00000000 00980003 00000000 cca6c692 0000482b 00000000 0049cf53 0049cf7a 0000cc06 bed80000 00000920 fffe0000 00000000 0000ffff ffff0001 00080049 cf530044 e295000e 00140009 00420065 00610063 0068002e 006a0070 0067000f 00060002 00480044 00120022 4c696272 6172792f 4465736b 746f7020 50696374 75726573 2f426561 63682e6a 70670013 00012f00 ffff0000&gt;;
    ImageFilePath = "/Library/Desktop Pictures/Beach.jpg";
    NewChangePath = "/Library/Desktop Pictures";
    NewImageFilePath = "/Library/Desktop Pictures/Beach.jpg";
    NoImage = 0;
    Placement = Crop;
    Random = 0;
};


I don't know how to get an alias as data for the ImageFileAlias key.