Added gallery settings and auto-refresh