Add nil check for custom image loaders

Also drops graceful support for iOS 5