minor code cleanup and small thumbnail support