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

https://jira.ets.berkeley.edu/jira/browse/CYB-255
Merge pull request #159 from christianv/CYB-255

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