implemented saving screenshot without the aid of the gateway script