Add attributes to image element