Something like this maybe:
Function hasPicture(oshp As Shape) As Boolean
If oshp.Type = msoPicture Then
hasPicture = True
Exit Function
End If
If oshp.Type = msoPlaceholder Then
If oshp.PlaceholderFormat.ContainedType = msoPicture Then
hasPicture = True
Exit Function
End If
End If
End Function
Function hasTargetPic(osld As Slide) As Boolean
Dim oshp As Shape
For Each oshp In osld.Shapes
If hasPicture(oshp) Then
If oshp.Name = "Picture 2" Or oshp.Name = "Picture 3" Then
hasTargetPic = True
Exit Function
End If
End If
Next oshp
End Function
Sub deleter()
Dim S As Long
For S = ActivePresentation.Slides.Count To 1 Step -1
If Not hasTargetPic(ActivePresentation.Slides(S)) Then _
ActivePresentation.Slides(S).Delete
Next S
End Sub