Rewrote get_thumbnail() 2 eliminate redundant code