Free on WordPress.orgPhoto Gallery by SupsysticThe free WordPress gallery plugin for grids, masonry, carousels, sliders and a lightbox, with 100+ ready-made styles.Get it free
If after page refresh the sorting order is back to default, most likely there is a plugin or theme conflict in your case. Please try to deactivate all your plugins one by one and check the issue. Thus you will find out which plugin causes the error. If it won’t help, try to switch temporarily to a standard WordPress theme.