I'm afraid PIL only works on a file basis, so you'll have to code the rest yourself. Fortunately, this is easy with Python:
for path, dirs, files in os.walk('randomDir'):
for fpath in files:
im = Image.open(os.path.join(path, fpath))
print(im.format, im.size)