Only tag existing files

Fixes #3088
Merge pull request #3119 from mano3m/develop_tagging

Only tag existing files