SELECT * FROM cms_imagegalleries WHERE active = '1' ORDER BY sorting ASC, id ASC