Modifications to import image function