The following code works in Chrome. But in Firefox the submit step is not working
The issue is that an image submit doesn't send the name "submit" it sends "submit_x" and "submit_y"
So you should check for
if (isset($_POST['submit_x']))...
EDIT: I've done a little more testing on this and it appears in Firefox (16) and IE(7, 8, 9) only the x and y get sent whereas in Chrome (23) and Safari (5.1) it also send the name too along with x and y.
So the safest way is to check for the value is : isset($_POST['name_x'])