this was removed in Horizon as 'not needed' in
26eebd4abbbabc1475bae61c51d1cfcf14dba770
however it is used to form a hint for glance.image constraint
in heat-dashboard.
Just copy-paste the method as it existed in horizon with minimal
adaptations.
Change-Id: I23fd3f45f0ce5b67691991336e727c377ca36281