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.