Fixes svg drawing functionality

Ref #78 

cc @javisantana 
I was being all clever by declaring img_name within the if condition statement. Yeah I'll take it outside.