fixed event so on delete media img is also deleted