Gallery update

Fix #1121 and #1073