This is why we can't diagnose you, you need to see your health care provider or a dermatologist... And I was indicating if you have had unprotected sex then you should get an STD Panel and that is what you need to do if you want to learn your status.
to be honest it doesnt look like herpes or STDs...its just a small pimple and no discharge or rash or itchiness or anything like that..just a little pain if you press on it..and i do shave my penis so that might be the case..i have had my penis checked like few months ago when i went for a checkup but at the time i didnt have the pimple..but my doctor said u dont have STDs..
If you've had unprotected Sex you need a full STD panel, this could very well be an STD... I suggest you seeing your health care provider and the next time you have an out break you need to see your doctor with in 24-48 hours to get a proper diagnosis.