Update rmi logic for canonical references
Update rmi logic for canonical references

Updates the rmi code to treat canonical references as related to tagged references from the same repository during deletion.
Canonical references with a different repository name will be treated as separate references.
Updates the remove by ID logic to still remove an image if there is a single tag reference and only canonical references to the same repository remaining.

Signed-off-by: Derek McGowan <e1c79a582b6629e6b39e9679f4bb964d25db4aa8@mcgstyle.net> (github: dmcgowan)

HuKeping/docker,lixiaobing1/docker,amatsus/docker,tophj-ibm/docker,sterchelen/docker,rremer/moby,shhsu/docker,sdurrheimer/docker,michael-holzheu/docker,sanjeo/docker,konstruktoid/docker-1,mikebrow/docker,mahak/docker,moypray/docker,SvenDowideit/docker,laijs/moby,estesp/docker,bonczj/moby-json-file-logger,yasiramin10p/moby,dmcgowan/docker,noironetworks/docker,13W/docker,KarthikNayak/docker,unclejack/docker,ripcurld0/moby,tagomoris/docker,abhinavdahiya/docker,Mokolea/docker,amatsus/docker,prertik/docker,vdemeester/docker,mtrmac/docker,asbjornenge/docker,endophage/docker,danyalKhaliq10p/moby,nalind/docker,cr7pt0gr4ph7/docker,kunalkushwaha/docker,tophj-ibm/moby,charleszheng44/moby,Ramzec/docker,dccurtis/docker,dperny/docker,trebonian/docker,scotttlin/docker,mtrmac/docker,mkumatag/docker,jhorwit2/docker,shhsu/docker,mtanlee/docker,afein/docker,rhatdan/docker,jwhonce/docker,hqhq/moby,mohmost12/docker,KingEmet/docker,cloudflare/docker,djs55/docker,darrenstahlmsft/moby,resin-io/docker,ibuildthecloud/docker,charleszheng44/moby,hqhq/moby,x1022as/docker,AkihiroSuda/docker,tklauser/docker,ajaymdesai/docker,icaoweiwei/docker,lixiaobing1/docker,ndeloof/docker,laijs/docker,mkumatag/docker,brahmaroutu/docker,trebonian/docker,jlebon/docker,13W/docker,containers/storage,shishir-a412ed/docker,nalind/docker,yummypeng/docker,stevvooe/docker,moul/docker,PatrickLang/moby,dnephin/docker,mohmost12/docker,cpuguy83/docker,yongtang/docker,13W/docker,gjaskiewicz/moby,catinthesky/docker,POLJM242/docker,mtanlee/docker,HuKeping/docker,splunk/docker,AkihiroSuda/docker,paralin/docker,miminar/docker,erikh/docker,xiekeyang/docker,JMesser81/docker,yongtang/docker,twaugh/docker,paralin/docker,whuwxl/docker,wenchma/docker,trebonian/docker,lixiaobing10051267/docker,fcrisciani/docker,ibuildthecloud/docker,yosifkit/docker,eskaaren/docker,HideoYamauchi/docker,crosbymichael/docker,kolyshkin/moby,endophage/docker,trebonian/docker,whuwxl/docker,dgageot/docker,pramodhkp/moby,srust/docker,pradipd/moby,kolyshkin/docker,erikstmartin/docker,darrenstahlmsft/docker,Mokolea/docker,pradipd/moby,moul/docker,rhatdan/docker,afein/docker,jlebon/docker,fcrisciani/docker,jameszhan/docker,akira-baruah/docker,rancher/docker,liaoqingwei/docker,justincormack/docker,jimjag/docker,xiaods/docker,darrenstahlmsft/docker,Syntaxide/docker,asbjornenge/docker,sfsmithcha/docker,mikebrow/docker,gschaetz/moby,jimjag/docker,qudongfang/docker,gnailuy/docker,haveatry/docker,mstanleyjones/docker,vdemeester/docker,sdurrheimer/docker,KingEmet/docker,konstruktoid/docker-upstream,portworx/docker,unclejack/docker,laijs/moby,PatrickLang/moby,harche/docker,jimjag/docker,tklauser/docker,mkumatag/docker,mikedougherty/docker,liaoqingwei/docker,SvenDowideit/docker,ndeloof/docker,konstruktoid/docker-1,nawawi/docker,gnailuy/docker,POLJM242/docker,mstanleyjones/docker,tophj-ibm/docker,tophj-ibm/moby,stevvooe/docker,xuxinkun/docker,moul/docker,asbjornenge/docker,dsau/docker,rancher/docker,whuwxl/docker,yp-engineering/docker,imkin/moby,mike1729/docker,moul/docker,msabansal/docker,miminar/docker,flavio/docker,tonistiigi/docker,mikedougherty/docker,jameszhan/docker,afein/docker,tkopczynski/docker,michael-holzheu/docker,laijs/docker,hypriot/docker,dgageot/docker,pradipd/moby,darrenstahlmsft/moby,harche/docker,kojiromike/docker,zhuguihua/docker,xiaods/docker,erikstmartin/docker,rhatdan/storage,prertik/docker,justincormack/docker,nawawi/docker,stevvooe/docker,cyphar/docker,srust/docker,erikh/docker,xiekeyang/docker,bearstech/moby,justyntemme/docker,jthelin/docker,icaoweiwei/docker,fcrisciani/docker,diogomonica/docker,jameszhan/docker,mtesselH/docker,sdurrheimer/docker,lixiaobing10051267/docker,tkopczynski/docker,sanjeo/docker,ibuildthecloud/docker,jlhawn/docker,dnephin/docker,johnstep/moby-moby,bearstech/moby,thtanaka/docker,mikebrow/docker,jvanz/docker,mikedougherty/docker,noironetworks/docker,flavio/docker,yp-engineering/docker,KingEmet/docker,naveed-jamil-tenpearls/moby,moypray/docker,ColinHebert/docker,alfred-landrum/docker,projectatomic/docker,tklauser/docker,jwhonce/docker,gjaskiewicz/moby,bluebreezecf/docker,laijs/docker,ffoysal/docker,laijs/moby,moby/moby,sterchelen/docker,YuPengZTE/docker,duglin/docker,docker/docker,nalind/docker,cloudflare/docker,kojiromike/docker,unclejack/docker,jlhawn/docker,tophj-ibm/docker,projectatomic/docker,prertik/docker,michelvocks/docker,noxiouz/docker,eskaaren/docker,akira-baruah/docker,raja-sami-10p/moby,dccurtis/docker,raja-sami-10p/moby,catinthesky/docker,catinthesky/docker,erikh/docker,tonistiigi/docker,djs55/docker,thaJeztah/docker,Morsicus/docker,ColinHebert/docker,sarnautov/moby,JMesser81/docker,haveatry/docker,erikstmartin/docker,dperny/docker,sterchelen/docker,13W/docker,Ramzec/docker,crosbymichael/docker,mtesselH/docker,yp-engineering/docker,bearstech/moby,coolljt0725/docker,vdemeester/docker,wenchma/docker,sarnautov/moby,dperny/docker,x1022as/docker,twaugh/docker,thaJeztah/docker,eskaaren/docker,ColinHebert/docker,dmcgowan/docker,yosifkit/docker,hypriot/docker,coreos/docker,gschaetz/moby,mtanlee/docker,mike1729/docker,gnailuy/docker,kencochrane/docker,dsau/docker,ajaymdesai/docker,mtrmac/docker,bearstech/moby,msabansal/docker,hqhq/moby,imkin/moby,cpuguy83/docker,srust/docker,maxamillion/docker,mixja/docker,Morsicus/docker,xiekeyang/docker,YuPengZTE/docker,ripcurld0/moby,icaoweiwei/docker,cpuguy83/docker,tmp6154/docker,ndeloof/docker,ffoysal/docker,sfsmithcha/docker,pramodhkp/moby,charleszheng44/moby,qudongfang/docker,jlebon/docker,pramodhkp/moby,sfsmithcha/docker,Morsicus/docker,13W/docker,resin-io/docker,KarthikNayak/docker,containers/storage,abhinavdahiya/docker,Syntaxide/docker,mtesselH/docker,thaJeztah/docker,dongjoon-hyun/docker,flavio/docker,coolljt0725/docker,diogomonica/docker,michelvocks/docker,kunalkushwaha/docker,Ramzec/docker,SvenDowideit/docker,dims/docker,rremer/moby,brahmaroutu/docker,kolyshkin/docker,estesp/docker,tkopczynski/docker,sarnautov/moby,dgageot/docker,johnstep/moby-moby,naveed-jamil-tenpearls/moby,mike1729/docker,dongjoon-hyun/docker,allencloud/docker,HideoYamauchi/docker,moby/moby,kunalkushwaha/docker,rhatdan/storage,moypray/docker,noxiouz/docker,hypriot/docker,endophage/docker,dccurtis/docker,tianon/docker,rhatdan/docker,johnstep/moby-moby,justyntemme/docker,jlhawn/docker,kojiromike/docker,qudongfang/docker,cyphar/docker,coreos/docker,paralin/docker,xuxinkun/docker,lixiaobing10051267/docker,docker/docker,docker/docker,shhsu/docker,xiaods/docker,bluebreezecf/docker,maxamillion/docker,diogomonica/docker,raja-sami-10p/moby,KarthikNayak/docker,mahak/docker,PatrickLang/moby,rremer/moby,splunk/docker,coreos/docker,AkihiroSuda/docker,yummypeng/docker,nawawi/docker,yosifkit/docker,haveatry/docker,jthelin/docker,thtanaka/docker,estesp/docker,danyalKhaliq10p/moby,dims/docker,bonczj/moby-json-file-logger,Mokolea/docker,allencloud/docker,michelvocks/docker,konstruktoid/docker-upstream,gjaskiewicz/moby,moby/moby,jimjag/docker,sanjeo/docker,mohmost12/docker,Syntaxide/docker,madhanrm/docker,alfred-landrum/docker,allencloud/docker,HideoYamauchi/docker,dims/docker,thtanaka/docker,zhuguihua/docker,dsheets/moby,cloudflare/docker,JMesser81/docker,cpuguy83/docker,konstruktoid/docker-upstream,tianon/docker,alfred-landrum/docker,q384566678/docker,dnephin/docker,tagomoris/docker,gschaetz/moby,cr7pt0gr4ph7/docker,rhatdan/storage,djs55/docker,containers/storage,projectatomic/docker,duglin/docker,dongjoon-hyun/docker,rancher/docker,tonistiigi/docker,harche/docker,tagomoris/docker,q384566678/docker,justyntemme/docker,tmp6154/docker,lixiaobing1/docker,kencochrane/docker,resin-io/docker,cyphar/docker,mstanleyjones/docker,crosbymichael/docker,yasiramin10p/moby,dsheets/moby,YuPengZTE/docker,dsheets/moby,kolyshkin/moby,mixja/docker,danyalKhaliq10p/moby,scotttlin/docker,twaugh/docker,ripcurld0/moby,Mokolea/docker,dsau/docker,jvanz/docker,noxiouz/docker,cr7pt0gr4ph7/docker,konstruktoid/docker-upstream,imkin/moby,flavio/docker,justincormack/docker,Ramzec/docker,yasiramin10p/moby,dmcgowan/docker,madhanrm/docker,jvanz/docker,darrenstahlmsft/docker,shishir-a412ed/docker,naveed-jamil-tenpearls/moby,jwhonce/docker,miminar/docker,moby/moby,noironetworks/docker,mixja/docker,nalind/docker,scotttlin/docker,wenchma/docker,bonczj/moby-json-file-logger,kencochrane/docker,AkihiroSuda/docker,yosifkit/docker,portworx/docker,msabansal/docker,tmp6154/docker,yongtang/docker,duglin/docker,jhorwit2/docker,splunk/docker,abhinavdahiya/docker,mahak/docker,kolyshkin/moby,ibuildthecloud/docker,madhanrm/docker,michael-holzheu/docker,yummypeng/docker,gnailuy/docker,x1022as/docker,konstruktoid/docker-1,bluebreezecf/docker,mahak/docker,thaJeztah/docker,nawawi/docker,paralin/docker,portworx/docker,jhorwit2/docker,q384566678/docker,zhuguihua/docker,ibuildthecloud/docker,coolljt0725/docker,HuKeping/docker,ajaymdesai/docker,xuxinkun/docker,ffoysal/docker,shishir-a412ed/docker,tophj-ibm/moby,maxamillion/docker,brahmaroutu/docker,amatsus/docker,darrenstahlmsft/moby,liaoqingwei/docker