Hi,
after a quick investigation, I found that even for an initial profile (i.e. purged before),
the "Image" for [Wallpaper][org.kde.image][General] is already set to the default image of the utilized theme
before any Plasma script is actually executed.
So the if-condition:
if (!d[i].readConfig('Image')) {
will never be true.
Cheers,
Oliver