Update post.php

The old way of checking for the validity of an attachment id was calling a function that does a lot of extra stuff, builds an html, uses a few other functions and if one of those extra is not working right then it fails.  This solution is simple and if an extra check is needed here then we should add that too  and no longedr use that old code