some renamings and refractorings
improved thumbnail handling