migrate some functions to screencast controller
create non existing img dir when taking capture