better support for editing galleries