added deleteThumbnails function.