Database

[{_id:1,photos:["image1.png","image2.png"]},{_id:2,photos:["image3.png","another_image.png, image5.jpg"]},{_id:3,photos:["image_name.jpg","image2.jpg"]}]

Query

db.collection.update({photos:{$regex:".png"}},[{$set:{photos:{$map:{input:"$photos",in:{$replaceOne:{input:"$$this",find:".png",replacement:".jpg"}}}}}}],{multi:true})

Result