fix bug in tests, img dir now created if not exists