Fix bug on extension of attachments

=> using guessExtension method