Huge performance improvements -- start just one phantomjs process right at the beginning, rather than on each request. Only initialize a page if a request is to be made (URL is valid, image is not already in FS, etc.)