Fix: Do not check whether path exists - check whether its a file
Fix: Do not check whether path exists - check whether its a file

This fixes a bug introduced in 195d921218559f98844e52cca2ebdfe12fcf6b71
where we didn't check whether the path is actually a file.

matthiasbeyer/imag,matthiasbeyer/imag