image attach function added