Add base64 support

Make it possible to save the thumbnails as base64 encoded data directly into the database.