refactored checkMemoryForImage handling

have a look to the detailed comment in MarkDown what all is included
(the GitHub for Windows doesn't interpret MarkDown here)