improved no-image handling in building template
Merge commit '895fb3f13cabe1da70669581b0391e7d1a751bdd'
removed legacy query