fix #1617 Refactors get_users method in gallery/models