Changed: make sure background image exists before using it
Changed: code style