using wp_insert_attachment() results in guids with file names different to the same file when uploaded via media page in admin

So I figured this out.

The function wp_insert_attachment() sanitizes file names parsed to it. In the process it was removing spaces in filenames. To avoid this I did my own sanitization (still using WP functions) before parsing the filenames.

I renamed my files using sanitize_file_name() and this added hyphens (what I desired really) into all teh spaces in the names. Then later in the code when I parse the details to wp_insert_attachment() no alteration of the file names occur and they stay with the hyphens.