Permissions to upload by post id changed

- Now checks the post type of the post id being passed
- Rename variable to make it clearer we are trying to upload to it (post_parent)