Fixed gallery bug