Only add a MetadataOnly element if no TiffData elements are present

This prevents validation errors for most OME-TIFF files; noticed by @qidane.
Merge pull request #1040 from melissalinkert/rebased/dev_5_0/metadataonly

Only add a MetadataOnly element if no TiffData elements are present (rebased onto dev_5_0)