Better image handling in accordion