The WIA reference is set in the VBE Tools menu as I showed in the comment. This is standard practice for early bound objects.
'Tools > References > Microsoft Windows Image Acquisition Library v2.0 > OK
Dim Img As ImageFile 'Early Binding
I used late binding for WIA object in the 2nd routine.
Change the value for p below. It may still need some work for landscape governed pics. As discussed previously, it would need a tweak if files don't use the leading 0's to six places naming convention. The shapes where named using the base filename so click the image to see the name in top left. This is a bit cleaner than adding text into a cell with the pic.
Sub Main()
Dim fn$, m$, p$, s As Shape, r As Range, c As Range
Dim pR As Range, cc As Range, fso As Object
Dim ws1 As Worksheet
'Folder with candidate jpg's
p = "C:\Users\ken\_Excel\Controls\Picture\CandidatePics\"
Set ws1 = Worksheets(1)
'Range with candidate names to match.
Set r = ws1.Range("F1", Worksheets(1).Range("F1").End(xlDown))
'Range with candidate names and base filenames with no leading 0's.
Set pR = Worksheets(2).UsedRange
Set fso = CreateObject("Scripting.FileSystemObject")
ws1.Columns("A:D").ColumnWidth = 20
ws1.Rows("1:" & WorksheetFunction.RoundUp(r.Cells.Count / 4, 0) + 1).RowHeight = 20
ws1.Pictures.Delete
Set cc = ws1.Range("A2")
On Error GoTo NextC
For Each c In r
'=VLOOKUP(F1,Sheet2!A1:B11,2,FALSE)
m = WorksheetFunction.VLookup(c, pR, 2, False)
fn = p & Format(m, "000000") & ".jpg"
If Dir(fn) = "" Then GoTo NextC
AddPicFNs fn, cc, Format(m, "000000")
NextC:
'Set next cell to add pic or not.
Set cc = cc.Offset(, 1)
'Move to next cell row column A if cc.column is more than 4.
If cc.Column > 4 Then Set cc = ws1.Cells(cc.Row + 1, "A")
Next c
End Sub
Sub AddPicFNs(fn$, c As Range, Optional shapeName$ = "")
Dim s As Shape, w As Single, h As Single, wS As Single
'https://docs.microsoft.com/en-us/previous-versions/windows/desktop/wiaaut/-wiaaut-imagefile#properties
Dim Img as object 'Late Binding
'Tools > References > Microsoft Windows Image Acquisition Library v2.0 > OK
'Dim Img As ImageFile 'Early Binding
'Get pic's hxw using WIA
Set Img = CreateObject("WIA.ImageFile")
Img.LoadFile fn
h = Img.Height 'pixels
w = Img.Width 'pixels
'hxw=594x792. 30x40" inserted as 8.25/11" = 792/1056 pixels, All ratio h/w=0.75. 96 pixels/1"
'Debug.Print h, w
Set Img = Nothing
'AddPicture as shape, linked pic or not linked as in this use.
wS = c.Height * w / h
Set s = ActiveSheet.Shapes.AddPicture(fn, msoFalse, msoCTrue, c.Left + c.Width / 2 - wS / 2, c.Top, wS, c.Height)
If shapeName <> "" Then s.Name = shapeName
End Sub