added functionality to delete an image from the gallery