Revert "Check if file extension already present"

This reverts commit 638cf8574afa6d1cb5067b3dfb271b0b7717ab83.
Revert "Revert "Check if file extension already present""

This reverts commit b4a8e7128e129b2e61edbe3916856c2a575a65c1.