While trying to delete these sites we realised that delete option for these libraries is not visible from the GUI. When we attempted to delete with the SharePoint Designe we got the error:
“Server Error: The folder selected for deletion contains one or more lists, document libraries, or galleries that your web site requires in order to function correctly. Therefore, you cannot delete the folder.” So there was no easy way for us to delete these libraries.
Then we started trying to hide these libraries. Hiding of these libraries is possible with SPList.Hidden property in the SharePoint user interface. Following is the code snippet with which the libraries were hided:
SPSite site = new SPSite(http://localhost/);
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Site Collection Documents"];
list.Hidden = true;
list.Update();
list = web.Lists["Site Collection Images"];
list.Hidden = true;
list.Update();