legend code (specifically image refernce) updated to fit into build structure cleanly