Refactor: Use database to manage images.
Bugfix: Fix media store image support.