added rudimentary thumbnails, some js logic