Added a promise and fixed bug in img src