Fixed using of uninitialized img_width variable