delete image function added to js