try using extern template
less magic in ImageFormat