Image upload using waffle_ecto

I am using waffle_ecto for image upload. I am trying to generate unique filenames for each upload. The unique file is uploaded to the local folder but the images are not showing up in the app.

This is my waffle_ecto file code

defmodule Shop.FileImage do
  use Waffle.Definition

  use Waffle.Ecto.Definition

  alias Ecto.UUID


  @versions [:original]

  

  # Whitelist file extensions:
  def validate({file, _}) do

    file_extension = file.file_name |> Path.extname() |> String.downcase()

    case Enum.member?(~w(.jpg .jpeg .gif .png), file_extension) do
      true -> :ok
      false -> {:error, "invalid file type"}
    end

  end
 

  # Override the persisted filenames:
  def filename(:original, _) do
    UUID.generate()
  end

 # ADDED FUNCTIONS FOR AVATAR 
  def avatar_changeset(user, attrs) do
    user
    |> cast(attrs, [])
    |> cast_attachments(attrs, [:avatar])
  end

The file is saved with a unique name in the uploads folder but the app is not picking up.Am I missing something in the changeset. Should I add some code before the cast_attachments.Thanks