Write a Python app with Flask that does the following:
1) API for user registration and login
2) Upload image and save it to MongoDb as base64 string (also save name as plain text)
3) HTML templates
NOTE: The app must be secure by using tokens. The user should not be able to do anything unless they are logged in and have a valid token. Tokens must expire 24 hours after creation and force user to re-login.