Secured way of loading S3 config

Also added filters for file types