Metadata.update_main_cover(): fix up code

It was not working as it should, new code is easier to understand too.