fixed part that was throwing indexerrors for certain images