Cambia
$cv = explode('_', $res['cv']);

con
$cv = explode( '_', substr($res['cv'], 0, 14) );

e
str_replace("retro.pdf", "", $cv[1])

con
$cv[1]