Added a setupMap function
Added an image preview API endpoint