Fixes svg drawing functionality

Ref #78 

cc @javisantana 
if the image is not loaded the img.width could be 0, right?