Cron task does not create images
As a possible (but possibly not the best) solution it might be the 'account_switcher' service could help. It would elevate permissions for your cron job. 

use Drupal\Core\Session\UserSession;

// call the account switcher service
$accountSwitcher = \Drupal::service('account_switcher');
// switch to the admin user
$accountSwitcher-&gt;switchTo(new UserSession(['uid' =&gt; 1]));

// run your code here

// switch back to old session
$accountSwitcher-&gt;switchBack();


zessx, please share your solution, if you've found one.

See original Q&amp;A here.