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.
Merge pull request #3131 from Just-m/JM-2014-25-11

Fixed #3131 Prevent PHP warning when viewing an order that references a product with no images.