Fix the repository filepicker

Check that the node is a DOMElement instance
before checking for width and height.

Add fallback in case width and height dont exist
or the width is the old style thumb width