Fixed crash caused by editing a gallery in the media tab