fixing image paths in JS