Stuck for 3 days at this width-height issue

Stuck for 3 days at this width-height issue

In my project (currently live for beta-testing at http://goo.gl/XNGnou), I need to find out the width & height of a certain element (image) on a webpage.

Basically, the user uploads an image (logo) which is resized to fit a certain space. 

Then I use this code to get the image width and height:

            $('#banner_468x60 .logo-container img').width();
            $('#banner_468x60 .logo-container img').height();
            

When everything goes well, after clicking Generate, a new page is opened with a preview and order form.
When it goes bad, it returns a server error.

The above code works fine in ~ 60-70% of the cases, however for some users the retrieved width and height are 0. Obviously, the whole app crashes when that happens.

It is only one banner that cause the issue, 468x60 (I knew that from server logs). It's so weird  because that's exactly the same code I use for the other 8 banners.

The problem occurs even if the users do not upload any logo (they go with the default image instead). So it's not about the picture they upload.

I'm stuck as I cannot replicate the issue on my testing environments. It seems that is not necessarily related to the browser (issue was reported on Chrome 37 and 41 as well).

Probably I did something stupid at some point but I miss any clue at this moment.

Any help and idea would be much appreciated.

Thank you!