background: Adding support for multiple ratios

These modifications will enable us to ship 2 background images, one for 16:9 and the second one for 4:3. idesk will then automatically pick one based on the size of the screen.

See https://github.com/KanoComputing/Spindle/issues/329.

Refactored some common code to a function (as @alex5imon suggested).