Added ability to set the background color depending on the image state