move imgs to separate folder, parse out main js html writing and ajax commands into separate files