Trying to pass id to the ajax callback function, keeps overwriting, how to solve this?
I'm sure you can pass some arguments to your callback by doing this:

$form['image-entry'][$some-&gt;id]['submit3' . $some-&gt;id] = array(
  '#type' =&gt; 'submit',
  '#value' =&gt; 'Delete',
  '#ajax' =&gt; array(
    'callback' =&gt; 'image_gallery_delete_photo_callback',
    'parameters'=&gt; array('param1'=&gt;$some-&gt;id)
   ),
);


Try to catch those parameters at your function image_gallery_delete_photo_callback($form, $form_state, $args)

The variable $args should contain 'param1'as your ID

Hope it helps !