Coherence and imaginarity of quantum states