var img = document.getElementById("img");

img.style.backgroundImage = "url('" + images[x] + "')";

이런식으로 해봤는데 안먹는다