changes legend to use img tags