Solving Linear Inverse Problems Using GAN Priors: An Algorithm with Provable Guarantees