i'm not sure why you even need to extract the hashtag from the comment...
... but assuming there's a reason, then yes, what you have for the 3-table design is fine
except for id(3), that's totally useless -- the PK for that table should be all three of the other columns
further, i don't agree that you need an id as a surrogate key for the hashtag itself -- just use the hashtag
the id for the photo is fine, because using the url is problematic because of its length
but the hashtag presumably is a single string of alphanumerics without any embedded special characters (e.g. spaces, commas, etc.) so the hashtag itself functions perfectly well as its own primary key