If the user is trying to put images in a directory, check if it esists and create if not.

Recently we used this lib within a project and found that it lacked functionality to create sub directories within the cache folder. This will now attempt to create the directory if not exist and return FALSE if it cannot.