Fixing bug when verifying cached content + concurrency related issue.

## 1 Cached content dir

When accessing directly an URL with a dir inside a cached directory (like `/media/cache/offer/media/` for `/media/cache/offer/media/thumb-image.jpg`) the response returns with a 500 code. After changing the using of `file_exists` by `is_file` function, to check if the path realy contains a file, the response return with a 404 code, that is "more" correct.

## 2 Concurrency

There is a PHP bug (https://bugs.php.net/bug.php?id=35326) related to recursive directory creation and concurrency. When calling the ImagineController with paralel requests, this bug is achieved, throwing an exception. To fix it, I added a second check for directory existence before throw the exception.