Background image support and Global variable leak fix

Added background image support
Altered the ifs to reduce jquery data calls.
Added a size undefined in case all options have not been added.