Colorbox wrong height when first opened / scrollbars appear

Colorbox seems to have a strange issue – if it contains image(s), when opened for the first time, sometimes it opens with the wrong height set so scrollbars appear. I’m not sure what causes this, as in my case I had width and height properties set to all images AND the images I tested with were already loaded by the browser.

Solution / workaround: trigger resize after colorbox has loaded.

onComplete: function() {
    $.colorbox.resize();
},