Fixed image scaling when a target dimension is unlimited.

[FIXED]     Scaling image: Target size may have infinite dimensions.