imgconvert: change logic in avcodec_get_pix_fmt_loss()

Avoid the use of the brittle/inconsistent information in
PixFmtInfo.depth, and implement a possibly more robust logic which
exposes the information in pixdesc.

Also allow the removal of PixFmtInfo.depth, since this is the only use
of it.
