use markdown; code refactor, thumbnail support