NYS DMV hasn't done "on the spot" driver's licenses in decades. You're going to have to bring the damaged license, fill out the form and pay the money to get it replaced. They'll give you a temp w/o a pic and mail the new one to you (probably within 10 days)..
The only problem you might have is that you mentioned the layer around the picture is coming off. If they feel the license was tampered with in any way, you may have to provide more proof of identity (such as a passport, a work ID, etc.) All the acceptable proofs can be found on the DMV website
New York State Department of Motor Vehicles - NYS DMV - NYSDMV - Driver - Vehicle