sooo... i read this book years ago, maybe 1992 and i remember that i loved it but not the title or author's name. (i was about 13.) i have googled what i can remember but it's not enough

maybe someone here will remember it!
the cover had a picture of a sailing ship
the main character was male, i remember him sailing on a ship. there were elemental spirits in bottles that the characters used for various things, such as wind to power the ship, light, ect. they also had personalities and were probably the coolest thing about the book.
the main character gets shipwrecked or boarded by pirates or something- he is then sold into slavery. i think his mistress falls in love with him.
and that's about it. i mostly remember the elementals being very interesting. i would love to read this book again, if anyone has any idea what the title could be please let me know
