Convert to AJAX
Load image over https
Add login/logout and database connection