Help!!

I was watering and checking on my plants that I’m growing on our 3rd story deck and noticed these tomatoes:

tomato1These are a lot more that I picked and threw in the trash because they look like this:

tomato2tomato3tomato4

There are some that look like this:

dsc_0637

…but I’m afraid they’re all headed in the gross direction.  So, does anybody have any thoughts about what is causing this?  And how to save the rest of the tomatoes?