l'errore che ti da è legato al file $img1... in pratica ti dice che non hai i permessi per aprirlo.. ti succede con tutti i files ?