fix(gallery): changed mysql to mysqli, fixed gallery class function calls