Reimplement image import

Signed-off-by: Jerome Flesch <jflesch@gmail.com>