I think it's in here somewhere.
FROM image image LEFT JOIN album album ON lower(album.album_name) = lower(album_name)
At first I thought the query should give you an error, because it seemed like "album_name" is an ambiuguous column.
REPLACE(SUBSTRING_INDEX(REVERSE(SUBSTRING_INDEX(RE
VERSE(image.image_path), '/', 2)), '/', 1), 'images', NULL) AS album_name
Maybe it would be better to alias the above expression to some other name like "album_name2".
Then maybe try joining :
FROM image image LEFT JOIN album album ON lower(album.album_name) = lower(album_name2)