optimaze background-image assignment