Bug 1055805: downsample large jpeg images before previewing as wallpaper

cherry-pick from master 4c318bbb7583393699711a240dc1c9d1c9c663a0