finish first version of destroying image. But changing to jquery ajax method to handle success and error callbacks