The priority is based on the Post Priority settings, but when the image sizes vary, particularly by a minimal amount, they can appear to be out of order.
It's very important that the images are exactly the same size in order for the tiles to follow post priority. For example, if the third post/image in a row is slightly smaller than the other images in that row, the highest priority tile in the next row will appear in the third position under the smaller image instead of appearing in the first position.
Posts that are expired, or not active, will not come into play. Only Active posts will follow any Post Priority.