Fix javascript photo tag bug