added support for images selected from a file input