[BUGFIX] Do not encode links from non-local storages

The check for non file URLs that was introduced
in #42223 does not take relative URLs into account,
which are also perfectly valid for some drivers.

Just check if the image resource URL is a local
file, because only then it makes sense to maybe
transform it to a GIF.

We also remove an obsolete check for file
in imageLinkWrap as the URL there can be either
an URL to a remote storage or an integer.

Related: #42223
Resolves: #51949
Releases: 6.0, 6.1, 6.2
Change-Id: I67c8cea1c3b4997558b99d244bae5ea6d509f923
Reviewed-on: https://review.typo3.org/23786
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel