Fix for breaking error on empty divs

When applied in divs with no image, the error callback is triggered before the settings object is defined, raising a TypeError that breaks the whole process.
Merge pull request #7 from tiagoroldao/patch-1

Fix for breaking error on empty divs