Wayward Thumbnail generation in dynamic PHP script
<p>This script snippet checks to see if a file exists in a directory and the builds a thumbnail.  For some reason before the _1.jpg thumbnail an empty thumbnails is created with just a .jpg?  Where is this happening, I can track it down?</p>

<p>Here is a tinyurl of the issue to see...best to test in IE as firefox automatically removes it:  <a href="http://tinyurl.com/c6o2yts" rel="nofollow">http://tinyurl.com/c6o2yts</a>                                 </p>

<pre><code>&lt;?
                                    $image = "&lt;br&gt;";
                                    $ListingRid = $row['ListingRid'];                                   
                                    $img_cnt = 1;
                                    $image .= "&lt;a href=/feeds/fmfl/rets_images/$ListingRid_1.jpg rel=enlargeimage::mouseover rev=loadarea&gt;&lt;img src=/feeds/fmfl/rets_images/$ListingRid_1.jpg alt='' width='100' height='75' border='0' /&gt;&lt;/a&gt;&amp;nbsp;";
                                    for ($c=1;$c&lt;10;$c++) {
                                        $c_ext = $c;
                                        if (file_exists("/var/www/vhosts/domain.com/httpdocs/feeds/fmfl/rets_images/{$ListingRid}_{$c_ext}.jpg"))
                                            $image .= "&lt;a href=/feeds/fmfl/rets_images/{$ListingRid}_{$c_ext}.jpg rel=enlargeimage::mouseover rev=loadarea&gt;&lt;img src=/feeds/fmfl/rets_images/{$ListingRid}_{$c_ext}.jpg alt='' width='100' height='75' border='0' /&gt;&lt;/a&gt;&amp;nbsp;";
                                        else
                                            $c=12;

                                        $img_cnt++;
                                        if ($img_cnt == 3) {
                                            $image .= "&lt;br&gt;";
                                            $img_cnt = 0;
                                        }

                                    }

                                    ?&gt;  
</code></pre>
