fix function to pass image to detail view