How to let users add tags for a post?

Hi,

I’m building a social network where people can upload images. I want to create a page with type of content ‘tags’, so that when users click on a tag, it will show all other images with the same tags. Users should be able to add up to 15 tags for each upload. Also, on the homepage, users should be able to search on this tag, and it needs to show all posts containing this tag.

What would be the best approach for this?

Option 1: Create a data type of ‘tag’, and add a list of posts as a field? So each time a new post is created and the tag doesn’t exist, it will create a new tag, and adding this post to this tag?

Option 2: Add a field of a list of tags or a list of text on the ‘post’ data type?

Please let me know what the best approach will be. I want users to choose their own tags, just like Youtube. So it will not be pre-made tags by me. After the post is uploaded, a list of tags will appear under the post, and when a user clicks on one of these tags, it will open a new page with all posts containing the same tags.

Thanks in advance!