Display legend only if the image really exists

and not on dubious `hasLegend`attribute in the BOD

Fix #463