By default, your images are sorted alphanumerically. What this means is that all numbers starting with a 1 will come before all numbers starting with a 2, etc.
For example, if you have a set of images that are named "Image_1" through "Image_300", they would be organized in the following way by default:
To avoid having your images organized in this way, which may seem random at first glance, you will need to pad your numbers with zeros to make them all an equal number of characters long.
For example, instead of naming your images "Image_1" through "Image_300", you might name them "Image_0001" through "Image_0300." When the numbers are padded in this way, they are automatically sorted in the way you would expect:
Many cameras come with an option to name their images in this way by default, and if you use Lightroom or other image management software for post-processing, the export dialog will generally allow the images to be named this way as well.
If you've already uploaded your images and you'd like some ideas on the easiest way to rearrange them now that they're uploaded, see the following article: How can I rearrange the images in my gallery?