refactory thumbnail