added support for background images, minor fixes