Prevent warning when no images present

When no images are present for a product, viewing an order that contains that product will generate a warning "trying to get property of non-object". `$Image->id` doesn't exist. Moving the line within the if-loop prevents the warning.