First version of the image selection with javascript