[DONE] Fix user avatar exceptions, added logs

use sprintf function http://php.net/manual/ru/function.sprintf.php