More work on the image results and page preview controller, and general code improvements