Fix bug that would cause the image to stay small

When opening the lightbox, the image might stay small
because of a race condition. This is fixed using a
deferred object.

Change-Id: I4e93c7d26da47e5177abeb1dac841bf6c25a9022
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/138
Merge "Fix bug that would cause the image to stay small"