moved image upload JS to script file from template