Using openfire as a datacenter

Hello,

is it possible to write a Component plugin (or anything else) in order to intercept messages posted to persistent MUCs, store them in a database (in place of storing them to html files - talking about conversation logs) and then, after openfire server restarts, the plugin to pull each MUC, each MUC logs from database and serve them as history to each MUC connecting party ?

What about pictures - does openfire support logging pictures / binary data sent to a conference room ? How does it treat them ?

Thanks!