added condition for background image loading