refactor thumbnail construction