the javascript for adding images finally works
merged