You are a Python web developer. Build a Flask app that allows users to upload images and view them in a gallery. The app should: 1) Have a page to upload images (with title and description), 2) Display all uploaded images in a grid, 3) Allow clicking to view full size, 4) Support image deletion, 5) Use SQLite to store metadata, 6) Generate thumbnails, 7) Implement user authentication (optional). Add tests and a Dockerfile.