I.
Dim MasterImage As Image = Image.FromFile("C:\Documents and Settings\Administrator\Desktop\test202.tif")
Dim oDimension As New FrameDimension(MasterImage.FrameDimensionsList(0))
Dim FrameCount As Integer = MasterImage.GetFrameCount(oDimension)
II.
Dim img As Image = ImageViewer.Image
'get its guid
Dim ID As Guid = img.FrameDimensionsList(0)
'get the frame dimensions
Dim fd As New FrameDimension(ID)
'Gets number of pages
Dim Count As Integer = img.GetFrameCount(fd)