layers: Refactor set/validate memory valid functions
layers: Refactor set/validate memory valid functions

Create custom image and buffer versions of functions to minimize casting.

KhronosGroup/Vulkan-LoaderAndValidationLayers,KhronosGroup/Vulkan-LoaderAndValidationLayers,KhronosGroup/Vulkan-LoaderAndValidationLayers,elongbug/Vulkan-LoaderAndValidationLayers,KhronosGroup/Vulkan-LoaderAndValidationLayers,elongbug/Vulkan-LoaderAndValidationLayers,elongbug/Vulkan-LoaderAndValidationLayers,elongbug/Vulkan-LoaderAndValidationLayers