improve block image function