Enhanced The Gallery Functionality