Check if file extension already present

If there is already a file extension then doesn't add extension again.