Fix a bug while getting information of images.
Refactory files.py.

Display images in the dashboard page.(tif format is not supported yet).