cleaned up getImageDir