Assuming you already know about the sort option at the top of your gallery in the menu, and you are asking to make picture sorting a task done by gallery by default so you dont have to mess with it everytime someone uploads a picture, this is how i did it:
On line 354 in your save_photos.php you will see-
$gallery->album->save();
right above that line add this:
$gallery->album->sortPhotos('upload',1);
That will make gallery display all photos from newest upload to oldest automatically.
If you would like to have it sort automagically using any of the other methods, replace ('upload',1) with one of the following:
('itemCapture',1)
('filename',1)
('click',1)
('caption',1)
('comment',1)
('random',1)
Also just so you know, the '1' tells it to sort ascending, using '0' would tell it to sort descending.
Keep in mind that this is just the default, and if you or someone who has rights, sorts it a different way using the sort option on the menu, it would stay the way you had just decided to sort it until someone uploaded a pic again, then it would go back to your default sort that you had hardcoded into the script above.