fixes syntax error with javascript and removes duplicate images"