Updated to support attributes on the img tag