Search for excited states of light and heavy flavor quarks in the $\gamma$+jet final state in proton-proton collisions at $\sqrts =$ 13 TeV