reworked thumbnail function and overall process flow for efficiency in walkdir