You're adding the javascript to the entire Row, not to the single ImageButton.
e.Row.Attributes.Add
So, I think, the javascript function will trigger for every button and link in the entire row.
Try to cast ADD_img to a ImageButton (and not to a String). Then
ADD_img.Attributes.Add("OnClick", "javascript:return openph(" & Edid_img & ")")
Sorry, I code in C# but should be the same.
Let me know!