image directory and updated API and example