adding latest working code for upload and save images/albums to DB