Studying images with JavaScript