add the matching class to a flag image