FIX BUG #8473 Cannot rename layers in composer legend

If the layer is a raster layer, the layer name is not updated with the
user defined text, instead of layer vector.