CYB-255 - Gallery sorting by comments, likes, and dislikes doesn't work

https://jira.ets.berkeley.edu/jira/browse/CYB-255