gallery bug fixes