Hey Divjot,

I am not sure which gallery panel you mean, but with the solution from the post you can only remove panels from the document sidebar, not the sidebar that is displayed when a block is selected.

Best,
Florian