make sure labels are only there when there is a legend image