Allow data-class attribute to be copied when replacing background image

When a div where the background image is replaced, the existing classes were not kept.