Creating tumbnail from images that gives to class