This can happen because of a low memory limit or to other server settings (file permission issues most of the time).
Ask your hosting company to check if the option
allow_url_fopen is set to “on” and if the function
file_get_contents is not blocked.
Please note that sometimes the
allow_url_fopen appears as activated even if it is not actually the case. For this reason, this has to be checked by an experienced technical support engineer.
This can also happen when you import templates from a localhost to another localhost or with a server which blocks the transfer of pictures from one site to another.