pass photodir as argument