Hello,
I would run the following manually and see if it still works:
Code:
/usr/bin/gconftool-2 --type string --set /desktop/gnome/background/picture_filename $BACKGROUND_LOC/$NEW_BACKGROUND
Most likely, this will be where the problem is, since you are probably using unity now. Can I ask what version you upgraded to? Also, install gconf-editor, and launch the utility, and browse to that said location, and see if it even exists. You may have to research the new config location to use within your script.
Cheers,
Josh