Refactoring gallery images ordering etc
Fixing gallery order bug