fix a gallery bug