Check that an image is not too long.
Improve handling the database instantiation and initialization.
Use a polling-based cache for the main page's json.