Check extension before generating thumbnail