JavaScript image capture using PhantomJS and CasperJS