remove hard-coded file extensions, support ImageFactory extensions instead
Previous patch for this issue broke in 2.10. Rather than update patch, am creating merge instead.
Previous patch for this issue broke in 2.10. Rather than update patch, am creating merge instead.