store image sizes in the database, include them in templates