You can sort assets stored in the JCR based on different props. For example, you could write an OSGi component that queries assets, sorts them based on a specific property, and then return a reset set to the page where they are displayed. Everything in CQ is just a resource. You can get at that resource using an API like JCR SQL/JCR API and sort it.