The only work around I can think of would be this
Dim xmldoc As New XmlDataDocument
Dim xNodes As XmlNodeList
Dim iImgCount As Integer
xmldoc.Load(MapPath("samplefolder/gallery.xml"))
xNodes = xmldoc.SelectNodes("NewDataSet/image")
iImgCount = xNodes.Count
If iImgCount > 15 Then
gallery1.ShowUpload = False
End If