First, you need the ListView which represents the adapter. If you store this somewhere already, great; if not, you can take the View which is passed to onClick() and call its getParent() method twice (or more, if the image is nested deeper within the clicked item's view) to get the ListView.
From there, call ListView.getPositionForView() on the View passed into onClick(). This will give you an int representing the position of the clicked item within the list adapter. From there, you can do whatever you want with it.
For example:
public void onClick(View v){
ListView lv = (ListView)(v.getParent().getParent()); // you may need more getParent()s and/or extra casting
int position = lv.getPositionForView(v);
/* Do whatever database stuff
* You want to do
*/
}