Fix dir check and also typo that made a very large image!!