Added function to scan a dir for images

Updated js to latest version
Added function to scan a dir for images