Add some logic into avimage namespace