You may want to look at the royalty free license terms governing your use of the stock photo. Most such licenses, in my experience, include restrictions on use of photos as marks. Ultimately, I'm not sure how that might substantively affect your rights as against the competitor, but in practical terms it could cause problems (e.g., your competitor might bring your TM use to the licensor's attention should you try to assert TM rights in the photo, thereby opening you to breach of contract liability).
I'd speak to an attorney directly if this is important to your business. In that context, you'll best be able to assess the risk/benefit/cost of your potential courses of action.