added check if images dir actually exists