sed trumps perl any day
restructure awk to know amount of urls beforehand
use -S to print HTML results for search
make some ugly effort to display thumbnails in html mode
fix thumbs, they were off-by-one (plus reorder code to reflect html order)