Avoid uncommitted transaction notices in thumb.php and img_auth.php

bug: 56269
Change-Id: I8cf5c070899d281c7efbac853f04c2fea9374e4d
(cherry picked from commit c993ec0095e80c939cdacea690d8677814cdbeb6)