imgconvert: Add the proper API guards to a deprecated function