Codice PHP:
for ($i 1$i <= 2$i++) { 
     if (
$nome =($immagine_oggetto.$i)!=""){ 
     ..... 
Forse volevi una cosa di questo tipo?