Fixed a PHP Fatal error. Called an object that did not exists.
Create the image dir if not exists.