How to find orphaned files and images which are not linked from any css stylesheet or from any node? Is there a way to list all unused files which reside inside public file system and inside a theme directory and list them, or maybe even have an option to delete them automatically?

I mean files which are currently not linked from any css stylesheet or from any node.
You can find orphaned files by running the following MySQL query:

SELECT fm.*
FROM file_managed AS fm
LEFT OUTER JOIN file_usage AS fu ON (fm.fid = fu.fid)
LEFT OUTER JOIN node AS n ON (fu.id = n.nid)
WHERE fu.type = 'node' AND n.nid IS NULL


This returns all files which have no associated node. I'm not sure if it's safe to delete the returned rows and files, probably also depends on your module setup. Only use at your own risk!

Source: http://drupal.org/node/733258#comment-5582764