def validate_bookcover(book_details):
    """
    Check if goodreads returns a nophoto
    Use open library to fetch the book cover
    based on ISBN

    Args:
        book_details: Book info returned as json by goodreads API

    Returns:
        This API checks for book cover, and returns with a valid
        bookcover if nophoto found on goodreads, using openlibrary
    """
    no_photo_url='https://s.gr-assets.com/assets/nophoto/book/'
    open_library_url='http://covers.openlibrary.org/b/isbn/{isbn}-M.jpg'

    if (book_details['image_url'].__contains__(no_photo_url)):
        book_details['image_url'] = open_library_url.format(isbn=book_details['isbn'])
    return book_details