I'm trying to work on getting nice image gallery but it seems that on each load the image order changes. Is there any way to stop this and keep set order or something?

This is the default and only one behavior. The gallery finds each time the tile that best fit the images, so the order is not considered.