Javascript thumbnail gallery code. Image gallery with thumbnails in JavaScript