Fix gallery bug