Improved forced media scanner code in attachmentsactivity.