move randomImage.js code top