Fix bug add and edit gallery