added image cache for the text attachments of image type

initWithContentsOfFile: doesn't use cache to load file contents, causing performance degrade when loading the same file many times.
So I've added image cache using NSCache for text attachments of image type, which are loaded from local file.