first try to remove the blobs in the media files table and replace them by a global data directory
fixing some new bugs
some comments enhanced