Since some of the files you want to return are images, it would be better to use 'rb', for binary.
Also, open() just returns the file object.  You actually want to return the content of the file, which you can do by doing a read() on it.