First of all, you won't get any "code aside" advice here. The purpose of this forum is to offer advice to DIYers on how to accomplish their plumbing tasks code legal. Second, the trap you show in the photo is not a P trap. It is an illegal S trap. To be a P trap, there would need to be a vent basically where the high point in the trap is. That is, before the drain makes the downward bend. I think you can use an AAV as you describe, but the S trap has to go.