Well may be it is to easy question but:
I want to sort the numbers by clicking an image. I thought that i make a form and add an imagefield.
If I am reading the question properly, then having the image as part of the form does not automatically submit the form as POST. The button made it work because you were actually submitting the form.
When you initially load the page, it will be a GET request with no relation to the form that you are showing us (and you could have numerous other forms in the page using different names, that would similarly have no effect unless submitted themselves). When you submit using the button, it requests index.php and adds the POST parameters.
Try adding onsubmit="submit-form();" to the input element?