LAMBDA-115: optimize get_cover and fix finish_encoding overwriting cover