Shiva, Hanuman, Ganesha and Gayatri deities are shown with 5 heads in idols but not Vishnu or Durga? What's the reason for this?
Having multiple head mean they are deities of tantrik cult.Vishnu do have a form with 4 heads known as vaikuntha or skatish according to pancaratra.The four head are - vishnu,nrsimha,varaha and kapila.
The Pancabrahma Upanishad describes five forms of realities (Brahman) or Shiva that arose from highest reality – Sadyojata, Aghora, Vamadeva, Tatpurusha and Ishana. He is panchatmak, who conceals all five Brahmas, and to realize him is moksha.
In Kamba Ramayanam (in Tamil), the significance of number five is beautifully narrated as follows: The son of one of the five elements (son of wind - Pavana Thanaya) crossed one of the five elements (water – the ocean), through one of the five elements (sky), met daughter of one of the five elements (daughter of earth - Sita Devi) burnt down Lanka by one of the five elements (fire).
Gayatri was the name initially applied to a metre of the Rig Veda (Mandala 3.62.10) consisting of 24 syllables. In particular, it refers to the Gayatri Mantra and the Goddess Gāyatrī as that mantra personified. The Gayatri mantra composed in this triplet form is the most famous. Most of the scholars identifies Gayatri as the feminine form of Gayatra, other name of Vedic Solar god which is also one of the synonyms of Savitri and Savitr.
However, the transition period of mantra turned into personification is still unknown.
The 5 faces of God/Goddess may refer to 5 elements of the Nature.
Vishnu was depicted with so many heads, which might have been drawn from Rig Vedic Sahasrasirsha of Rig Vedic Purusha Sukta. And, Durga was depicted with multiple hands.