added functionality for variable image backgrounds